diff options
-rwxr-xr-x | contrib/completion/git-completion.bash | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 2ac356705b..8593fd707b 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2216,11 +2216,14 @@ _git () return fi - local expansion=$(__git_aliased_command "$command") - [ "$expansion" ] && command="$expansion" - local completion_func="_git_${command//-/_}" - declare -F $completion_func >/dev/null && $completion_func + declare -F $completion_func >/dev/null && $completion_func && return + + local expansion=$(__git_aliased_command "$command") + if [ -n "$expansion" ]; then + completion_func="_git_${expansion//-/_}" + declare -F $completion_func >/dev/null && $completion_func + fi } _gitk () |