mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-19 14:01:57 +00:00
Avoid tag/branch duplication if same value
This commit is contained in:
parent
1ab41d9a6c
commit
ce16b087c6
1 changed files with 6 additions and 2 deletions
|
@ -67,8 +67,12 @@ function +vi-git-tagname() {
|
||||||
local tag
|
local tag
|
||||||
|
|
||||||
tag=$(git describe --tags --exact-match HEAD 2>/dev/null)
|
tag=$(git describe --tags --exact-match HEAD 2>/dev/null)
|
||||||
# Append the tag segment to the branch one
|
head=$(git describe --all)
|
||||||
[[ -n "${tag}" ]] && hook_com[branch]+=" $(print_icon 'VCS_TAG_ICON')${tag}"
|
# 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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue