Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

git: Fix git amend on panel (#38681)

Alvaro Parker271d67f7adde
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index f8df51357da..b2c855f0fa3 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<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,