File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -134,20 +134,32 @@ __gitcomp_file_direct ()
134134 __gitcomp_file " $1 " " "
135135}
136136
137+ __git_complete_command ()
138+ {
139+ emulate -L zsh
140+
141+ local command=" $1 "
142+ local completion_func=" _git_${command// -/ _} "
143+ if (( $+ functions[$completion_func ] )) ; then
144+ emulate ksh -c $completion_func
145+ return 0
146+ else
147+ return 1
148+ fi
149+ }
150+
137151__git_zsh_bash_func ()
138152{
139153 emulate -L ksh
140154
141155 local command=$1
142156
143- local completion_func=" _git_${command// -/ _} "
144- declare -f $completion_func > /dev/null && $completion_func && return
157+ __git_complete_command " $command " && return
145158
146159 local expansion=$( __git_aliased_command " $command " )
147160 if [ -n " $expansion " ]; then
148161 words[1]=$expansion
149- completion_func=" _git_${expansion// -/ _} "
150- declare -f $completion_func > /dev/null && $completion_func
162+ __git_complete_command " $expansion "
151163 fi
152164}
153165
You can’t perform that action at this time.
0 commit comments