aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/completion/git-completion.bash5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 4ea727b14..8722a6879 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -91,7 +91,10 @@ __git_ps1 ()
fi
if ! b="$(git symbolic-ref HEAD 2>/dev/null)"
then
- b="$(cut -c1-7 $g/HEAD)..."
+ if ! b="$(git describe --exact-match HEAD 2>/dev/null)"
+ then
+ b="$(cut -c1-7 $g/HEAD)..."
+ fi
fi
fi