From 2119ac42d70e8e40c927cf9e423eb6a32de9a21b Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 12 Nov 2025 15:13:29 +0100 Subject: [PATCH] git_panel: Fix partially staged changes not showing up (#42530) Release Notes: - N/A --- crates/git_ui/src/git_panel.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 85cfb3b499f5cc2baefdc23f8e0ffc91f09b620d..81732732aff257b513faaf5f87ce85596a842dd8 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -3980,9 +3980,9 @@ impl GitPanel { .map(|ops| ops.staging() || ops.staged()) .or_else(|| { repo.status_for_path(&entry.repo_path) - .map(|status| status.status.staging().has_staged()) + .and_then(|status| status.status.staging().as_bool()) }) - .unwrap_or(entry.staging.has_staged()); + .or_else(|| entry.staging.as_bool()); let mut is_staged: ToggleState = is_staging_or_staged.into(); if self.show_placeholders && !self.has_staged_changes() && !entry.status.is_created() { is_staged = ToggleState::Selected; @@ -4102,7 +4102,9 @@ impl GitPanel { } }) .tooltip(move |_window, cx| { - let action = if is_staging_or_staged { + // If is_staging_or_staged is None, this implies the file was partially staged, and so + // we allow the user to stage it in full by displaying `Stage` in the tooltip. + let action = if is_staging_or_staged.unwrap_or(false) { "Unstage" } else { "Stage"