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)