Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 2/2] Changed Git revision lookup behavior to invoke Git directly.



This fixes a bug where the revision was empty for the time between when
Git packs refs and you make a commit.
---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 979f017..01bf9f3 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -101,11 +101,8 @@ VCS_INFO_git_getbranch () {
 
 gitdir=${vcs_comm[gitdir]}
 gitbranch="$(VCS_INFO_git_getbranch ${gitdir})"
-if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision && \
-    [[ ${gitbranch} == refs/* ]] && \
-    [[ -r "${gitdir}/${gitbranch}" ]] ; then
-
-    gitsha1="${"$(< $gitdir/$gitbranch)"}"
+if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
+    gitsha1=$(${vcs_comm[cmd]} rev-parse --quiet --verify HEAD)
 else
     gitsha1=''
 fi
-- 
1.7.2



Messages sorted by: Reverse Date, Date, Thread, Author