Merge branch 'sb/t5400-remove-unused'
[gitweb.git] / contrib / completion / git-prompt.sh
index 9d684b10a67ea663410db3ba68482c1a52bbc367..729f7694795d1116ccedfc653f82da757e6e4ef4 100644 (file)
@@ -270,7 +270,7 @@ __git_ps1_colorize_gitstring ()
 
 __git_eread ()
 {
-       f="$1"
+       local f="$1"
        shift
        test -r "$f" && read "$@" <"$f"
 }
@@ -468,7 +468,8 @@ __git_ps1 ()
                        fi
                fi
                if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] &&
-                  [ -r "$g/refs/stash" ]; then
+                  git rev-parse --verify --quiet refs/stash >/dev/null
+               then
                        s="$"
                fi