From bc0f8bd83f90b071efe9820cd71e735cf1683f3a Mon Sep 17 00:00:00 2001 From: Matt Smiley Date: Fri, 25 Mar 2016 17:11:46 -0700 Subject: [PATCH] When working from a detached head that has an associated tag, show that tag instead of the short SHA1 hash, even if it is unannotated. --- gitstatus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.sh b/gitstatus.sh index cd1a85f..95e4380 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -60,7 +60,7 @@ if [[ "$branch" == *"Initial commit on"* ]]; then branch="${fields[3]}" remote="_NO_REMOTE_TRACKING_" elif [[ "$branch" == *"no branch"* ]]; then - tag=$( git describe --exact-match ) + tag=$( git describe --tags --exact-match ) if [[ -n "$tag" ]]; then branch="$tag" else