Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 1/2] vcs_info git: Flatten a nested if.
- X-seq: zsh-workers 43314
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 1/2] vcs_info git: Flatten a nested if.
- Date: Sat, 18 Aug 2018 15:57:18 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=mm5XAsgK1sxEPPjla SW0XBNtHqmaHTEACbUmZMoJOms=; b=jIsCDulS6aYduSlIm9/4IWPNkyrkebzGU gVW0I4cwN5smGrgz+AgXSG7UvNMl2UD+BJboltTqPKbkpwRp3jeMjbWLiXRQHrEk q/DIPX7jOm/tDCrexDDGnprqAxrebD81IEPDoLqyt0hNfGU12lEbHeqJzbGqMZkP nFHYND4tW3nQp55yxbUDE3AH0skjsVj8n0OzN9XQodGB9Ez0uvrqZwMJcml6l/VZ VIpN7QW0x/vYs6h/0L14hh/aDScrP6yRTeb5C3c7B1ZMQCkQFEdqFQ9GVGZACjEc x2vaQTUhYG7GE6Zlo5m1ird4UP/nxSEhBNDsXVtrf/9g6AwDQML9g==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=mm5XAsgK1sxEPPjla SW0XBNtHqmaHTEACbUmZMoJOms=; b=RSme7VmcQEigCbOmkQwIj4As8OWsBldz5 tLWCBnmFaBcFfGeQ28kGGXse2U6jF7lHUS+y3RYwDn7/EL3wOYAxd0zoNJTKxeqb pypn9amgMLWDft0fNzlCtkLZZ0QJSfo3TyR6p/GTVJDWcP/+tStu1+HuYm32anxP FEY9hhwvcg/BYsAXhAEdEQ75tE57jwa6T+KWeJalXBwhZhw98n+qZPHcwubEFaed l8oX0aetI30/hc+Ae7RH8w5InLPDApom0VIPjOpwBR8iKUuLITqApn7AivCX0qFv d+oLAvIXm5iVUEwcmSbMexT8A7SvqnmAvA7hRFwwmOWTN1bFqLnaQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
No functional change.
---
Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author