From 07ead04890f0c0b90f9f5c166a1e5fd896a24bff Mon Sep 17 00:00:00 2001 From: Lorenzo Albano Date: Sun, 8 Jun 2025 13:24:53 +0200 Subject: [PATCH] Improve fish_git_prompt stashes detection. When the informative status is disabled, the stashstate variable was set to 1 if the $git_dir/logs/refs/stash file existed and was readable, even if the file itself was empty (i.e., no stashes). Now the stashstate variable is set only if the file is NOT empty. --- share/functions/fish_git_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/fish_git_prompt.fish b/share/functions/fish_git_prompt.fish index 97514e89d..ae4642eec 100644 --- a/share/functions/fish_git_prompt.fish +++ b/share/functions/fish_git_prompt.fish @@ -315,7 +315,7 @@ function fish_git_prompt --description "Prompt function for Git" # *compute* the informative status, we might still count the stash. if contains -- "$__fish_git_prompt_show_informative_status" yes true 1 set stashstate (count < $git_dir/logs/refs/stash) - else + else if test -s $git_dir/logs/refs/stash set stashstate 1 end end