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

[PATCH 4/4] _git: Don't shadow global aliases



---
 Completion/Unix/Command/_git | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index e2d3d6e..6f7a462 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -8116,15 +8116,11 @@ _git() {
         _git_commands && ret=0
         ;;
       (option-or-argument)
-        local -a aliases
         local -A git_aliases
-        local a k v
+        local a
         local endopt='!(-)--end-of-options'
-        aliases=(${(0)"$(_call_program aliases git config -z --get-regexp '\^alias\\.')"})
-        for a in ${aliases}; do
-            k="${${a/$'\n'*}/alias.}"
-            v="${a#*$'\n'}"
-            git_aliases[$k]="$v"
+        for a in ${(0)"$(_call_program aliases git config -z --get-regexp '\^alias\\.')"}; do
+          git_aliases[${${a/$'\n'*}/alias.}]=${a#*$'\n'}
         done
         local git_alias=git_aliases[\$words[1]]
         if (( ${(P)+git_alias} && !$+commands[git-$words[1]] && !$+functions[_git-$words[1]] )); then
-- 
2.27.0




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