Avoid tag/branch duplication if same value

pull/22/head
Niccolò Maggioni 9 years ago
parent 1ab41d9a6c
commit ce16b087c6
No known key found for this signature in database
GPG Key ID: 4874B0C841E33264

@ -67,8 +67,12 @@ function +vi-git-tagname() {
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}"
head=$(git describe --all)
# Make sure that detached head and tag differ in name
if [[ "${head}" != "${tag}" ]]; then
# Append the tag segment to the branch one
[[ -n "${tag}" ]] && hook_com[branch]+=" $(print_icon 'VCS_TAG_ICON')${tag}"
fi
fi
}

Loading…
Cancel
Save