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

[PATCH] _git: Handle zero defined aliases better



---

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



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