From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1574 invoked by alias); 26 May 2010 23:18:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27977 Received: (qmail 8913 invoked from network); 26 May 2010 23:18:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at cis.fu-berlin.de does not designate permitted sender hosts) Date: Thu, 27 May 2010 00:57:02 +0200 From: Holger Weiss To: Zsh Workers Subject: [PATCH] _git shouldn't return 0 if there are no matches Message-ID: <20100526225702.GA15615202@CIS.FU-Berlin.DE> Mail-Followup-To: Zsh Workers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 160.45.11.138 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