about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2021-04-07 21:48:48 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2021-04-21 00:57:59 +0000
commit9353b12e99827b29b224e5860bcb94636558d01a (patch)
treec5c67fb7ab067433979352c5510658246c8192d8 /Functions
parentb68a7421bd7d6bbcde6d282a56b38c30894449d5 (diff)
downloadzsh-9353b12e99827b29b224e5860bcb94636558d01a.tar.gz
zsh-9353b12e99827b29b224e5860bcb94636558d01a.tar.xz
zsh-9353b12e99827b29b224e5860bcb94636558d01a.zip
users/26635 (tweaked): vcs_info hg: Compute the branch name correctly when get-revision is set and check-for-changes is not
Tweak: Simplify an always-true condition.

Review-by: Manuel Jacob
Diffstat (limited to 'Functions')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_hg6
1 files changed, 3 insertions, 3 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index f7e9d6f45..2806aee1d 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -49,7 +49,7 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
         # Settling for a short (but unique!) hash because getting the full
         # 40-char hash in addition to all the other info we want isn't
         # available in a single hg invocation
-        hgid_args=( id -i -n -b )
+        hgid_args=( id -i -n )
 
         # Looking for changes is a tad bit slower since the dirstate cache must
         # first be refreshed before being read
@@ -58,12 +58,12 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
 
         local HGPLAIN
         HGPLAIN=1 ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \
-            | read -r r_csetid r_lrev r_branch
+            | read -r r_csetid r_lrev
     fi
 fi
 
 # If the user doesn't opt to invoke hg we can still get the current branch
-if [[ -z ${r_branch} && -r ${branchfile} ]] ; then
+if [[ -r ${branchfile} ]] ; then
     r_branch=$(< ${branchfile})
 fi