summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarc Finet <m.dreadlock@gmail.com>2014-09-16 22:57:26 +0200
committerFrank Terbeck <ft@bewatermyfriend.org>2014-09-16 23:20:52 +0200
commit2c2d4f9627258640df44a4da4e5627e4d8c5044d (patch)
treeaaadddfd699ef600fa7bd3fc8eab8820495894fd
parentcd09b8162673c44dc0984dc18da3c98beda550cc (diff)
downloadzsh-2c2d4f9627258640df44a4da4e5627e4d8c5044d.tar.gz
zsh-2c2d4f9627258640df44a4da4e5627e4d8c5044d.tar.xz
zsh-2c2d4f9627258640df44a4da4e5627e4d8c5044d.zip
33188: vcs_info git: set rrn before using it
This would fix handling get-revision, check-for-changes or
check-for-staged-changes when set per repository.
-rw-r--r--ChangeLog5
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a06461fa3..037604772 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-16  Marc Finet  <m.dreadlock@gmail.com>
+
+	* 33188: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
+	vcs_info git: set rrn before using it
+
 2014-09-16  Mikael Magnusson  <mikachu@gmail.com>
 
 	* 33136: Doc/Zsh/expn.yo, Src/glob.c: P glob qualifier appends
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 8f9aa2a19..24efab22e 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -115,6 +115,8 @@ VCS_INFO_git_getbranch () {
 
 gitdir=${vcs_comm[gitdir]}
 VCS_INFO_git_getbranch ${gitdir}
+gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel )
+rrn=${gitbase:t}
 if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
     gitsha1=$(${vcs_comm[cmd]} rev-parse --quiet --verify HEAD)
 else
@@ -154,8 +156,6 @@ fi
 
 VCS_INFO_adjust
 VCS_INFO_git_getaction ${gitdir}
-gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel )
-rrn=${gitbase:t}
 
 local patchdir=${gitdir}/patches/${gitbranch}
 if [[ -d $patchdir ]] && [[ -f $patchdir/applied ]] \