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

[PATCH] __git_commit_objects_prefer_recent: local ret



From: Daniel Hahler <git@xxxxxxxxxx>

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



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