1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-14 01:51:22 +02:00

25487: whitespace changes from Mikael Magnusson.

This commit is contained in:
Clint Adams 2008-08-19 01:10:15 +00:00
parent 123ebafbba
commit 117d3ded00
2 changed files with 47 additions and 44 deletions

View file

@ -1,5 +1,8 @@
2008-08-19 Clint Adams <clint@zsh.org> 2008-08-19 Clint Adams <clint@zsh.org>
* 25487: Completion/Unix/Command/_git: whitespace changes from
Mikael Magnusson.
* 25486: Completion/Unix/Command/_git: patch to allow --shared to * 25486: Completion/Unix/Command/_git: patch to allow --shared to
be completed without --local with git clone. be completed without --local with git clone.

View file

@ -4256,18 +4256,18 @@ __git_is_indexed () {
[[ -n $(git ls-files $REPLY) ]] [[ -n $(git ls-files $REPLY) ]]
} }
local curcontext=$curcontext ret=1 local curcontext=$curcontext ret=1
# fun with $words[] and $CURRENT to enable completion for args # fun with $words[] and $CURRENT to enable completion for args
# to git aliases (eg. git co <TAB>) # to git aliases (eg. git co <TAB>)
local -A git_aliases local -A git_aliases
# TODO: filling git_aliases like this is ugly. I didn't get it working elegantly. # TODO: filling git_aliases like this is ugly. I didn't get it working elegantly.
local oifs=$IFS local oifs=$IFS
IFS=$'\0' IFS=$'\0'
git_aliases=(${=${(0)${(@)${${${(f)"$(git config --get-regexp alias.\*)"}/(#s)alias./}/ /$'\0'}}}}) git_aliases=(${=${(0)${(@)${${${(f)"$(git config --get-regexp alias.\*)"}/(#s)alias./}/ /$'\0'}}}})
IFS=$oifs ; unset oifs IFS=$oifs ; unset oifs
if (( CURRENT >= 3 )) && [[ -n ${git_aliases[$words[2]]} ]] ; then if (( CURRENT >= 3 )) && [[ -n ${git_aliases[$words[2]]} ]] ; then
local -a tmpwords local -a tmpwords
tmpwords=(${words[1]} ${(z)git_aliases[$words[2]]}) tmpwords=(${words[1]} ${(z)git_aliases[$words[2]]})
if [[ -z "${words[3,-1]}" ]] ; then if [[ -z "${words[3,-1]}" ]] ; then
@ -4278,9 +4278,9 @@ __git_is_indexed () {
words=("${tmpwords[@]}") words=("${tmpwords[@]}")
(( CURRENT += ${#${(z)git_aliases[$words[2]]}} - 1 )) (( CURRENT += ${#${(z)git_aliases[$words[2]]}} - 1 ))
unset tmpwords unset tmpwords
fi fi
if [[ $service == git ]]; then if [[ $service == git ]]; then
local state line local state line
declare -A opt_args declare -A opt_args
_arguments -C \ _arguments -C \
@ -4301,9 +4301,9 @@ __git_is_indexed () {
_call_function ret _git-$words[1] _call_function ret _git-$words[1]
;; ;;
esac esac
else else
_call_function ret _$service _call_function ret _$service
fi fi
} }
_git _git