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 ()
134
134
__gitcomp_file " $1 " " "
135
135
}
136
136
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
+
137
151
__git_zsh_bash_func ()
138
152
{
139
153
emulate -L ksh
140
154
141
155
local command=$1
142
156
143
- local completion_func=" _git_${command// -/ _} "
144
- declare -f $completion_func > /dev/null && $completion_func && return
157
+ __git_complete_command " $command " && return
145
158
146
159
local expansion=$( __git_aliased_command " $command " )
147
160
if [ -n " $expansion " ]; then
148
161
words[1]=$expansion
149
- completion_func=" _git_${expansion// -/ _} "
150
- declare -f $completion_func > /dev/null && $completion_func
162
+ __git_complete_command " $expansion "
151
163
fi
152
164
}
153
165
You can’t perform that action at this time.
0 commit comments