about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrank Terbeck <bewater@users.sourceforge.net>2010-07-19 19:20:27 +0000
committerFrank Terbeck <bewater@users.sourceforge.net>2010-07-19 19:20:27 +0000
commit9b2334cf558b7537047d40c239acc07dcecd5232 (patch)
treef29249b6e36f26d19ff789fe0255c2786b17d300
parent76aef28b3147fb5ea944c793452e2d5ca3b348fe (diff)
downloadzsh-9b2334cf558b7537047d40c239acc07dcecd5232.tar.gz
zsh-9b2334cf558b7537047d40c239acc07dcecd5232.tar.xz
zsh-9b2334cf558b7537047d40c239acc07dcecd5232.zip
28093, based on Michel Lespinasse: 28090: Fix a problem with `check-for-changes' and freshly initialised repositories.
-rw-r--r--ChangeLog8
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git4
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 600a859d6..e80ca97d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-19  Frank Terbeck  <ft@bewatermyfriend.org>
+
+	* 28093, based on Michel Lespinasse: 28090:
+	Functions/VCS_Info/Backends/VCS_INFO_get_data_git: Fix a problem
+	with `check-for-changes' and freshly initialised repositories.
+
 2010-07-15  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 28073: Src/exec.c, Src/init.c, Src/utils.c: allow #!
@@ -13379,5 +13385,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5026 $
+* $Revision: 1.5027 $
 *****************************************************
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 778d0610b..9765a6e5a 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -121,8 +121,8 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" && \
     # Default: off - these are potentially expensive on big repositories
     ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules --quiet --exit-code ||
         gitunstaged=1
-    ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD ||
-        gitstaged=1
+    ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD 2> /dev/null
+    (( $? && $? != 128 )) && gitstaged=1
 fi
 
 VCS_INFO_adjust