mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-28 15:01:21 +02:00
43314: vcs_info git: Flatten a nested if.
No functional change.
This commit is contained in:
parent
f95635a447
commit
4cfbbf9ca5
@ -1,3 +1,8 @@
|
||||
2018-08-24 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 43314: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
|
||||
vcs_info git: Flatten a nested if.
|
||||
|
||||
2018-08-24 Oliver Kiddle <okiddle@yahoo.co.uk>
|
||||
|
||||
* 43330: Completion/BSD/Command/_cu: complete more options
|
||||
|
@ -104,16 +104,11 @@ VCS_INFO_git_getbranch () {
|
||||
elif [[ -d "${gitdir}/.dotest-merge" ]] ; then
|
||||
gitbranch="$(< ${gitdir}/.dotest-merge/head-name)"
|
||||
|
||||
elif gitbranch="$(${(z)gitsymref} 2> /dev/null)" ; then
|
||||
elif gitbranch="refs/tags/$(${vcs_comm[cmd]} describe --all --exact-match HEAD 2>/dev/null)" ; then
|
||||
elif gitbranch="${${"$(< $gitdir/HEAD)"}[1,7]}..." ; then
|
||||
else
|
||||
gitbranch="$(${(z)gitsymref} 2> /dev/null)"
|
||||
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
gitbranch="refs/tags/$(${vcs_comm[cmd]} describe --all --exact-match HEAD 2>/dev/null)"
|
||||
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
gitbranch="${${"$(< $gitdir/HEAD)"}[1,7]}..."
|
||||
fi
|
||||
fi
|
||||
# Can't happen
|
||||
fi
|
||||
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user