From 74c1ec5bacfec4791957186db7b760d6de8f5092 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 01:11:14 -0400 Subject: [PATCH] Show a disabled stage all button for no entries (cherry-pick #26436) (#26437) Cherry-picked Show a disabled stage all button for no entries (#26436) Closes #ISSUE Release Notes: - N/A Co-authored-by: Conrad Irwin --- crates/git_ui/src/git_panel.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 9422ad7d60ea9ec8a768e08b97ca348048c78934..dc25b917d9da576309f707ed6cb243c4f18aa82a 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -2451,7 +2451,7 @@ impl GitPanel { let text; let action; let tooltip; - if self.total_staged_count() == self.entry_count { + if self.total_staged_count() == self.entry_count && self.entry_count > 0 { text = "Unstage All"; action = git::UnstageAll.boxed_clone(); tooltip = "git reset"; @@ -2492,6 +2492,7 @@ impl GitPanel { action.as_ref(), &self.focus_handle, )) + .disabled(self.entry_count == 0) .on_click(move |_, _, cx| { let action = action.boxed_clone(); cx.defer(move |cx| {