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 modal and panel amend tooltip (#39008)

Miaof96fd928d745
diff --git a/crates/git_ui/src/commit_modal.rs b/crates/git_ui/src/commit_modal.rs
index b7088f27e91..4637b873eca 100644
--- a/crates/git_ui/src/commit_modal.rs
+++ b/crates/git_ui/src/commit_modal.rs
@@ -455,7 +455,11 @@ impl CommitModal {
if can_commit {
Tooltip::with_meta_in(
tooltip,
- Some(&git::Commit),
+ Some(if is_amend_pending {
+ &git::Amend
+ } else {
+ &git::Commit
+ }),
format!(
"git commit{}{}",
if is_amend_pending { " --amend" } else { "" },
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index d97f6282331..8f9320b2173 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -3458,7 +3458,7 @@ impl GitPanel {
if can_commit {
Tooltip::with_meta_in(
tooltip,
- Some(&git::Commit),
+ Some(if amend { &git::Amend } else { &git::Commit }),
format!(
"git commit{}{}",
if amend { " --amend" } else { "" },