slightly more understandable code structure
parent
43f62c6979
commit
926dcf6dcc
|
|
@ -9,6 +9,7 @@ _command_exists git || return 0
|
||||||
# Don't handle completion if it's already managed
|
# Don't handle completion if it's already managed
|
||||||
! complete -p git &>/dev/null || return 0
|
! complete -p git &>/dev/null || return 0
|
||||||
|
|
||||||
|
_git_bash_completion_found=false
|
||||||
_git_bash_completion_paths=(
|
_git_bash_completion_paths=(
|
||||||
# MacOS non-system locations
|
# MacOS non-system locations
|
||||||
'/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash'
|
'/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash'
|
||||||
|
|
@ -17,11 +18,14 @@ _git_bash_completion_paths=(
|
||||||
|
|
||||||
for _comp_path in "${_git_bash_completion_paths[@]}" ; do
|
for _comp_path in "${_git_bash_completion_paths[@]}" ; do
|
||||||
if [ -r "$_comp_path" ] ; then
|
if [ -r "$_comp_path" ] ; then
|
||||||
|
_git_bash_completion_found=true
|
||||||
source "$_comp_path"
|
source "$_comp_path"
|
||||||
unset _git_bash_completion_paths
|
break
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if ! _git_bash_completion_found ; then
|
||||||
|
_log_warning "no completion files found - please try enabling the 'system' completion instead."
|
||||||
|
fi
|
||||||
unset _git_bash_completion_paths
|
unset _git_bash_completion_paths
|
||||||
_log_warning "no completion files found - please try enabling the 'system' completion instead."
|
unset _git_bash_completion_found
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue