zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: zsh-workers@zsh.org
Subject: [PATCH] __git_commit_objects_prefer_recent: local ret
Date: Thu, 21 May 2015 19:30:50 +0200	[thread overview]
Message-ID: <1432229450-21417-1-git-send-email-genml+zsh-workers@thequod.de> (raw)

From: Daniel Hahler <git@thequod.de>

Without this, `ret` will be set to 1 with `git diff --ex<tab>` and
result in duplicate entries:

   % git diff --ex<tab>
    -- option --
   --exit-code    -- report exit code 1 if differences, 0 otherwise
   --exit-code  -- report exit code 1 if differences, 0 otherwise
   --ext-diff     -- allow external diff helper to be executed
   --ext-diff   -- allow external diff helper to be executed
   --no-ext-diff  -- disallow external diff helper to be executed
    -- recent commit object name --

I am not sure if this is the right way to do it.
---
 Completion/Unix/Command/_git | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index c886cc9..c9f0b72 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5605,6 +5605,7 @@ __git_remote_branch_names_noprefix () {
 
 (( $+functions[__git_commit_objects_prefer_recent] )) ||
 __git_commit_objects_prefer_recent () {
+  local ret  # Keep "ret" local here, used in __git_recent_commits.
   __git_recent_commits || __git_commit_objects
 }
 
-- 
2.4.0.dirty


             reply	other threads:[~2015-05-21 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 17:30 Daniel Hahler [this message]
2015-05-21 18:05 ` Bart Schaefer
2015-05-21 18:37   ` Daniel Hahler
2015-05-21 21:07     ` Bart Schaefer
2015-05-21 23:04       ` Daniel Hahler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432229450-21417-1-git-send-email-genml+zsh-workers@thequod.de \
    --to=genml+zsh-workers@thequod.de \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).