about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git8
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3051eef36..ad475b0aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@
 	* 31175: Doc/Zsh/zle.yo: 31175: Add documentation for the new -i
 	and -f options of vared
 
+	* 31221: Completion/Unix/Command/_git: Handle zero defined aliases
+	better
+
 2013-04-04  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 31203: Completion/Unix/Command/.distfiles,
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] )) ||