git: Fix git modal and panel amend tooltip (#39008)

Miao created

Closes #38783

Release Notes:

- Fixed the amend button tooltip shortcut in Git panel and modal.

Change summary

crates/git_ui/src/commit_modal.rs | 6 +++++-
crates/git_ui/src/git_panel.rs    | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)

Detailed changes

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 { "" },

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 { "" },