aboutsummaryrefslogtreecommitdiff
path: root/functions/vcs.zsh
diff options
context:
space:
mode:
authorNiccolò Maggioni <nicco.maggioni@gmail.com>2016-03-22 20:24:34 +0300
committerNiccolò Maggioni <nicco.maggioni@gmail.com>2016-03-22 20:24:34 +0300
commit4fdf5df25884ecfaa6668dbc152ee5e7c573d8d2 (patch)
tree265c9a1f629e2d03fbbaba1c8106d7e9dd6229fe /functions/vcs.zsh
parent89fefbdf6edb353e557bde8fd484d8d2460518d8 (diff)
Documentation
Diffstat (limited to 'functions/vcs.zsh')
-rw-r--r--functions/vcs.zsh3
1 files changed, 3 insertions, 0 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh
index 92731d52..af247d9c 100644
--- a/functions/vcs.zsh
+++ b/functions/vcs.zsh
@@ -61,10 +61,13 @@ 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
local tag
tag=$(git describe --tags --exact-match HEAD 2>/dev/null)
+ # Append the tag segment to the branch one
[[ -n "${tag}" ]] && hook_com[branch]+=" $(print_icon 'VCS_TAG_ICON')${tag}"
fi
}