diff options
author | Clint Adams <clint@users.sourceforge.net> | 2008-09-07 16:52:26 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2008-09-07 16:52:26 +0000 |
commit | 07462f8303174f1118b1641b7a6520144e240ce7 (patch) | |
tree | 1bbf78fbebe53431cc4cd7c419ad49429b80a773 /Completion/Unix/Command | |
parent | db31a13ecdd8306aad63319ace28bf7d029d4829 (diff) | |
download | zsh-07462f8303174f1118b1641b7a6520144e240ce7.tar.gz zsh-07462f8303174f1118b1641b7a6520144e240ce7.tar.xz zsh-07462f8303174f1118b1641b7a6520144e240ce7.zip |
Frank Terbeck: 25624: clean up git alias parsing.
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r-- | Completion/Unix/Command/_git | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index fa8274d44..87c43126b 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -4272,11 +4272,12 @@ local curcontext=$curcontext ret=1 # fun with $words[] and $CURRENT to enable completion for args # to git aliases (eg. git co <TAB>) local -A git_aliases -# TODO: filling git_aliases like this is ugly. I didn't get it working elegantly. -local oifs=$IFS -IFS=$'\0' -git_aliases=(${=${(0)${(@)${${${(f)"$(git config --get-regexp alias.\*)"}/(#s)alias./}/ /$'\0'}}}}) -IFS=$oifs ; unset oifs +local -a git_aliases__ +git_aliases__=(${(f)${${${(f)"$(_call_program alias_expansion git config --get-regexp '\^alias\.')"}#alias.}/ /$'\n'}/(#e)/$'\n'}) +if (( ( ${#git_aliases__} % 2 ) == 0 )) ; then + git_aliases=(${git_aliases__}) +fi +unset git_aliases__ if (( CURRENT >= 3 )) && [[ -n ${git_aliases[$words[2]]} ]] ; then local -a tmpwords expalias |