completions/git: Return from the function instead of using a flag

Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
Jean-Sébastien Hedde
2022-02-04 16:31:35 +01:00
committed by Koichi Murase
parent 8fa9c34c43
commit 5516f7e2ed

View File

@@ -1,7 +1,7 @@
# bash completion support for Git.
_omb_completion_git_initialize() {
if ! _omb_util_function_exists __gitdir; then
local is_completion_loaded=0 path
local path
for path in $(type -aP git);
do
path="${path%/git}"
@@ -10,15 +10,12 @@ _omb_completion_git_initialize() {
do
local _file="$prefix/$file"
if [[ -f $_file && -r $_file ]]; then
is_completion_loaded=1
source "$_file"
break 2
return
fi
done
done
if [[ $is_completion_loaded == 0 ]]; then
source "$OSH/tools/git-completion.bash"
fi
source "$OSH/tools/git-completion.bash"
fi
}
_omb_completion_git_initialize