diff options
| author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2018-08-18 15:37:44 +0000 |
|---|---|---|
| committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2018-08-24 15:49:38 +0000 |
| commit | 4cfbbf9ca5f1f7f6e79681fbad43daf674157727 (patch) | |
| tree | b289980f69acc96beee95e58e028fa7f9244a6a1 | |
| parent | 43330: complete more options to cu (diff) | |
| download | zsh-4cfbbf9ca5f1f7f6e79681fbad43daf674157727.tar zsh-4cfbbf9ca5f1f7f6e79681fbad43daf674157727.tar.gz zsh-4cfbbf9ca5f1f7f6e79681fbad43daf674157727.tar.bz2 zsh-4cfbbf9ca5f1f7f6e79681fbad43daf674157727.tar.lz zsh-4cfbbf9ca5f1f7f6e79681fbad43daf674157727.tar.xz zsh-4cfbbf9ca5f1f7f6e79681fbad43daf674157727.tar.zst zsh-4cfbbf9ca5f1f7f6e79681fbad43daf674157727.zip | |
43314: vcs_info git: Flatten a nested if.
No functional change.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 13 |
2 files changed, 9 insertions, 9 deletions
@@ -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 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index f3dd95dcb..a44a62c79 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -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 |
