mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 13:41:56 +00:00
git-tagname: reducing conditionals in logic
This commit is contained in:
parent
f060a90c58
commit
6fde7bf3fd
1 changed files with 4 additions and 1 deletions
|
@ -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}" ||
|
||||
|
|
Loading…
Reference in a new issue