From 10055b050c25e50f47882b3998fbe1d9372c1b3a 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 85cfb3b499..81732732af 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"