bash prompt: use bash builtins to check stash state
[gitweb.git] / contrib / completion / git-prompt.sh
index 6e8f486e6638d951d744a29d31a239a25a087302..afa867030de12916358d24e63c4335b4f43c8a91 100644 (file)
@@ -435,8 +435,9 @@ __git_ps1 ()
                                i="#"
                        fi
                fi
-               if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then
-                       git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$"
+               if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] &&
+                  [ -r "$g/refs/stash" ]; then
+                       s="$"
                fi
 
                if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&