1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 04:40:59 +01:00

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.
This commit is contained in:
Daniel Hahler 2015-05-17 19:35:22 +02:00
parent 6bfe6fd84b
commit 1e7bb4a8f8
2 changed files with 7 additions and 2 deletions

View file

@ -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