git: Fix git amend on panel (#38681)

Closes #38651 

`git_panel.set_amend_pending(false, cx);` was being called before
`git_panel.commit_changes(...)` which was causing the commit buffer to
be cleared/reset before actually sending the commit request to git.

Introduced by #35268 which added clear buffer functionality to the
`set_amend_pending` function.

Release Notes:

- Fix git amend on panel sending "Update ..." instead of the original
commit message
- FIx git amend button not working
This commit is contained in:
Alvaro Parker
2025-09-23 09:20:49 -06:00
committed by GitHub
parent 2e87387e53
commit 271d67f7ad
+3 -2
View File
@@ -1425,7 +1425,6 @@ impl GitPanel {
self.load_last_commit_message_if_empty(cx);
} else {
telemetry::event!("Git Amended", source = "Git Panel");
self.set_amend_pending(false, cx);
self.commit_changes(
CommitOptions {
amend: true,
@@ -1599,6 +1598,9 @@ impl GitPanel {
});
self.pending_commit = Some(task);
if options.amend {
self.set_amend_pending(false, cx);
}
}
pub(crate) fn uncommit(&mut self, window: &mut Window, cx: &mut Context<Self>) {
@@ -3445,7 +3447,6 @@ impl GitPanel {
telemetry::event!("Git Committed", source = "Git Panel");
git_panel
.update(cx, |git_panel, cx| {
git_panel.set_amend_pending(false, cx);
git_panel.commit_changes(
CommitOptions { amend, signoff },
window,