diff options
author | Niccolò Maggioni <nicco.maggioni@gmail.com> | 2016-03-25 12:51:33 +0300 |
---|---|---|
committer | Niccolò Maggioni <nicco.maggioni@gmail.com> | 2016-03-25 12:51:33 +0300 |
commit | 1ab41d9a6c9e2a4f62e3ebaac71cb2a87dde20cb (patch) | |
tree | 08173286a5316358d53fdc4fbb0e0be7bd64746f /functions/vcs.zsh | |
parent | 4fdf5df25884ecfaa6668dbc152ee5e7c573d8d2 (diff) |
Better DETACHED_HEAD detection
Diffstat (limited to 'functions/vcs.zsh')
-rw-r--r-- | functions/vcs.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh index af247d9c..368251b6 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -63,7 +63,7 @@ function +vi-git-remotebranch() { function +vi-git-tagname() { # Only show the tag name if we are not in DETACHED_HEAD state, # since in that case it would already be displayed in the branch segment - if [[ -n "$(git status | grep 'HEAD detached')" ]] ; then + if [[ -z "$(git symbolic-ref HEAD 2>/dev/null)" ]] ; then local tag tag=$(git describe --tags --exact-match HEAD 2>/dev/null) |