From 271d67f7adde107a728fe2e9d4cb964ac91cd15b Mon Sep 17 00:00:00 2001 From: Alvaro Parker <64918109+AlvaroParker@users.noreply.github.com> Date: Tue, 23 Sep 2025 12:20:49 -0300 Subject: [PATCH] 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 --- crates/git_ui/src/git_panel.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index f8df51357da99909b28e871a8aa6202328d2412d..b2c855f0fa341c19e7f44446e37240ee5a70e5e6 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -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) { @@ -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,