summaryrefslogtreecommitdiff
path: root/functions/vcs.zsh
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2016-04-12 16:30:28 +0300
committerBen Hilburn <bhilburn@gmail.com>2016-04-12 17:42:34 +0300
commit6fde7bf3fdce11ab38e50bbcc48e96cb22166d42 (patch)
treee346306887d57b8614653f88d8fb6990c50eabf2 /functions/vcs.zsh
parentf060a90c5888b24f59ea6076db076e662519390e (diff)
git-tagname: reducing conditionals in logic
Diffstat (limited to 'functions/vcs.zsh')
-rw-r--r--functions/vcs.zsh5
1 files changed, 4 insertions, 1 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh
index 074d1e05..c2b8185a 100644
--- a/functions/vcs.zsh
+++ b/functions/vcs.zsh
@@ -67,7 +67,10 @@ function +vi-git-tagname() {
local tag
tag=$(git describe --tags --exact-match HEAD 2>/dev/null)
- if [[ -z "$(git symbolic-ref HEAD 2>/dev/null)" || ! -z "${tag}" ]] ; then
+ # if [[ -z "$(git symbolic-ref HEAD 2>/dev/null)" || ! -z "${tag}" ]] ; then
+ if [[ -n "${tag}" ]] ; then
+ # There is a tag that points to our current commit. Need to determine if we
+ # are also on a branch, or are in a DETACHED_HEAD state.
head=$(git describe --all)
# Make sure that detached head or checked out name differs from tag name
if [[ "${head}" != "${tag}" ||