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

[PATCH] _git shouldn't return 0 if there are no matches



This patch fixes the problem that the _git completion function returns 0
even if no matches were generated (which leads to any additional
completers not being executed).

_git handles the completion for a sub-command such as "git foo" by
calling the function _git-foo via _call_function.  Without this patch,
_git then returns the status returned by _call_function (which is 0 if
_call_function was able to call _git-foo) instead of the status returned
by _git-foo.
---
 Completion/Unix/Command/_git |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index aef5e7c..cb06d57 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -4471,11 +4471,13 @@ if [[ $service == git ]]; then
       else
         curcontext="${curcontext%:*:*}:git-$words[1]:"
         _call_function ret _git-$words[1]
+        return ret
       fi
       ;;
   esac
 else
   _call_function ret _$service
+  return ret
 fi
 }
 
-- 
Holger



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