From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5045 invoked by alias); 5 Apr 2013 18:15:29 -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: 31221 Received: (qmail 22846 invoked from network); 5 Apr 2013 18:15:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: [PATCH] _git: Handle zero defined aliases better Date: Fri, 5 Apr 2013 19:54:03 +0200 Message-Id: <1365184443-8781-1-git-send-email-ft@bewatermyfriend.org> X-Mailer: git-send-email 1.8.2.rc1 In-Reply-To: <877gkgc2j1.fsf@ft.bewatermyfriend.org> References: <877gkgc2j1.fsf@ft.bewatermyfriend.org> X-Df-Sender: [pbs]NDMwNDQ0 --- Come to think of it, I don't remember writing this. But I think this will fix the issue. Completion/Unix/Command/_git | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 2b6a369..32d139a 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -4757,7 +4757,13 @@ __git_aliases () { (( $+functions[__git_extract_aliases] )) || __git_extract_aliases () { - aliases=(${^${${(0)"$(_call_program aliases "git config -z --get-regexp '^alias.'")"}#alias.}/$'\n'/:alias for \'}\') + local -a tmp + tmp=(${${(0)"$(_call_program aliases "git config -z --get-regexp '^alias.'")"}#alias.}) + if (( ${#tmp} > 0 )); then + aliases=(${^tmp/$'\n'/:alias for \'}\') + else + aliases=() + fi } (( $+functions[__git_date_formats] )) || -- 1.8.2.rc1