about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorFrank Terbeck <ft@bewatermyfriend.org>2013-04-05 19:54:03 +0200
committerFrank Terbeck <ft@bewatermyfriend.org>2013-04-05 20:19:33 +0200
commitabb32da0e76791dbf4aff9758caf10579b3035cb (patch)
treed18384b72e54747a61068bc51c9c28021b214632 /Completion/Unix/Command
parentdd638aea93c920228f164e38e350cd6388a6a645 (diff)
downloadzsh-abb32da0e76791dbf4aff9758caf10579b3035cb.tar.gz
zsh-abb32da0e76791dbf4aff9758caf10579b3035cb.tar.xz
zsh-abb32da0e76791dbf4aff9758caf10579b3035cb.zip
31221: Handle zero defined aliases better
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_git8
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2b6a36956..32d139acb 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] )) ||