bash prompt: use bash builtins to check for unborn branch for dirty state
[gitweb.git] / contrib / completion / git-prompt.sh
index 88d6121d2e8072c2999d3046451acb199599dedd..6e8f486e6638d951d744a29d31a239a25a087302 100644 (file)
@@ -429,7 +429,7 @@ __git_ps1 ()
                   [ "$(git config --bool bash.showDirtyState)" != "false" ]
                then
                        git diff --no-ext-diff --quiet --exit-code || w="*"
-                       if git rev-parse --quiet --verify HEAD >/dev/null; then
+                       if [ -n "$short_sha" ]; then
                                git diff-index --cached --quiet HEAD -- || i="+"
                        else
                                i="#"