File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -3035,6 +3035,17 @@ _git_worktree ()
3035
3035
fi
3036
3036
}
3037
3037
3038
+ __git_complete_command () {
3039
+ local command=" $1 "
3040
+ local completion_func=" _git_${command// -/ _} "
3041
+ if declare -f $completion_func > /dev/null 2> /dev/null; then
3042
+ $completion_func
3043
+ return 0
3044
+ else
3045
+ return 1
3046
+ fi
3047
+ }
3048
+
3038
3049
__git_main ()
3039
3050
{
3040
3051
local i c=1 command __git_dir __git_repo_path
@@ -3094,14 +3105,12 @@ __git_main ()
3094
3105
return
3095
3106
fi
3096
3107
3097
- local completion_func=" _git_${command// -/ _} "
3098
- declare -f $completion_func > /dev/null 2> /dev/null && $completion_func && return
3108
+ __git_complete_command " $command " && return
3099
3109
3100
3110
local expansion=$( __git_aliased_command " $command " )
3101
3111
if [ -n " $expansion " ]; then
3102
3112
words[1]=$expansion
3103
- completion_func=" _git_${expansion// -/ _} "
3104
- declare -f $completion_func > /dev/null 2> /dev/null && $completion_func
3113
+ __git_complete_command " $expansion "
3105
3114
fi
3106
3115
}
3107
3116
You can’t perform that action at this time.
0 commit comments