about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2015-05-17 19:35:22 +0200
committerDaniel Hahler <git@thequod.de>2015-05-19 05:42:21 +0200
commit1e7bb4a8f8c965e0ad61b09154f04b31aa57e07b (patch)
tree67245e2f871f6549c5fffceadbcf158861525778
parent6bfe6fd84b2c5d62f95ebd1afcd241050515f512 (diff)
downloadzsh-1e7bb4a8f8c965e0ad61b09154f04b31aa57e07b.tar.gz
zsh-1e7bb4a8f8c965e0ad61b09154f04b31aa57e07b.tar.xz
zsh-1e7bb4a8f8c965e0ad61b09154f04b31aa57e07b.zip
35164: fix __git_commit_objects/__git_recent_commits
$pipestatus for `: foo` is 0 always.

Without this, "git checkout" in a non-git directory would complete " ",
but not result in a note/error about not being in a git dir.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 88376c078..a1067a7de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-19  Daniel Hahler  <zsh@thequod.de>
+
+	* 35164: Completion/Unix/Command/_git: fix $pipestatus with
+	__git_commit_objects/__git_recent_commits.
+
 2015-05-19  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* users/20222: Completion/Unix/Command/_git: users/20222:
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index a40ebe988..6901b42e3 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5661,7 +5661,7 @@ __git_commit_objects () {
 
   # Note: the after-the-colon part must be unique across the entire array;
   # see workers/34768
-  : ${(A)commits::=${(f)"$(_call_program commits git --no-pager log -1000 --all --reflog --format='%h:\[%h\]\ %s\ \(%cr\)')"}}
+  commits=(${(f)"$(_call_program commits git --no-pager log -1000 --all --reflog --format='%h:\[%h\]\ %s\ \(%cr\)')"})
   __git_command_successful $pipestatus || return 1
 
   _describe -V -t commits 'commit object name' commits
@@ -5676,7 +5676,7 @@ __git_recent_commits () {
 
   # Careful: most %d will expand to the empty string.  Quote properly!
   # NOTE: we could use %D directly, but it's not available in git 1.9.1 at least.
-  : "${(A)commits::=${(@f)"$(_call_program commits git --no-pager log -20 --format='%h%n%d%n%s\ \(%cr\)')"}}"
+  commits=(${(@f)"$(_call_program commits git --no-pager log -20 --format='%h%n%d%n%s\ \(%cr\)')"})
   __git_command_successful $pipestatus || return 1
 
   for i j k in "$commits[@]" ; do