Skip to content

Commit 83dcf14

Browse files
committed
execute commit promotion on repository
1 parent 189a27a commit 83dcf14

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/core/OSTreeTUI.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ int OSTreeTUI::main(const std::string& repo, const std::vector<std::string>& sta
148148
* add deletion button & ask for confirmation (also add keyboard functionality)
149149
* TODO maybe re-arrange the manager window to remove the tabs again
150150
* now that promotion and deletion is gone / changed, we have enough rooom to fit both the info and the filter
151-
*/
151+
* TODO update the ostree-tui after promotion
152+
* the new, promoted (or deleted) commit doesn't get updated
153+
* might need a new component for that, as Component::Stacked seems like a fixed component (not modifyable)
154+
* TOOD code cleanup: snake_case to camelCase (consistent)
155+
*/
152156
// commit promotion state
153157
bool inPromotionSelection{false};
154158
std::string promotionHash{""};

src/core/commitComponent.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ class CommitComponentImpl : public ComponentBase, public WindowOptions {
322322
Button(" Promote [y] ", [&] {
323323
promoting = true;
324324
inPromotionSelection = false;
325+
// promote on the ostree repo
326+
ostreerepo.promoteCommit(hash, promotionBranch, {}, newSubject, true);
325327
resetWindow();
328+
// TODO refresh the ostree-tui to show the new commit
326329
}) | color(Color::Green) | flex,
327330
})
328331
});

0 commit comments

Comments
 (0)