summaryrefslogtreecommitdiff
path: root/functions/vcs.zsh
diff options
context:
space:
mode:
authorNiccolò Maggioni <nicco.maggioni@gmail.com>2016-03-22 19:51:01 +0300
committerNiccolò Maggioni <nicco.maggioni@gmail.com>2016-03-22 19:51:01 +0300
commit89fefbdf6edb353e557bde8fd484d8d2460518d8 (patch)
treeb2a11bc1c41a84183a0661c0e5892139a9548370 /functions/vcs.zsh
parentb46a96a7cee43ed35c319e04800a5d043e371163 (diff)
DETACHED_HEAD handling
Diffstat (limited to 'functions/vcs.zsh')
-rw-r--r--functions/vcs.zsh2
1 files changed, 2 insertions, 0 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh
index 847275fa..92731d52 100644
--- a/functions/vcs.zsh
+++ b/functions/vcs.zsh
@@ -61,10 +61,12 @@ function +vi-git-remotebranch() {
}
function +vi-git-tagname() {
+ if [[ -n "$(git status | grep 'HEAD detached')" ]] ; then
local tag
tag=$(git describe --tags --exact-match HEAD 2>/dev/null)
[[ -n "${tag}" ]] && hook_com[branch]+=" $(print_icon 'VCS_TAG_ICON')${tag}"
+ fi
}
# Show count of stashed changes