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.

master
Matt Smiley 10 years ago committed by Matt Smiley
parent 485d12adb3
commit bc0f8bd83f
  1. 2
      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

Loading…
Cancel
Save