Skip to main content

fish_functions/fish_prompt: fix check for bare repositories

ID
6be2e49
date
2026-04-18 12:33:09+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
f1f5dc7
message
fish_functions/fish_prompt: fix check for bare repositories
changed files
1 file, 2 additions, 2 deletions

Changed files

fish_functions/fish_prompt.fish (5228) → fish_functions/fish_prompt.fish (5236)

diff --git a/fish_functions/fish_prompt.fish b/fish_functions/fish_prompt.fish
index eef8928..9aec87d 100644
--- a/fish_functions/fish_prompt.fish
+++ b/fish_functions/fish_prompt.fish
@@ -28,8 +28,8 @@ function print_git_information
     which git 2>&1 >/dev/null
 
     set is_bare (git rev-parse --is-bare-repository 2> /dev/null)
-    if string match $is_bare "false\n"
-        true
+    if string match --quiet "true*" $is_bare
+        return
     end
 
     set branch (git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')