forked from ohmybash/oh-my-bash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ohmybash#277 from jeansebastienh/bump-git-completion
completions/git: bump to v2.34.1
- Loading branch information
Showing
4 changed files
with
3,694 additions
and
2,777 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! bash oh-my-bash.module | ||
# bash completion support for Git. | ||
_omb_completion_git_initialize() { | ||
if ! _omb_util_function_exists __gitdir; then | ||
local git_paths path | ||
IFS=$'\n' read -r -d '' -a git_paths <<< "$(type -aP git)" | ||
# Note: Falling back on /usr (should already be in the array) | ||
git_paths+=("/usr/bin/git") | ||
for path in "${git_paths[@]}"; do | ||
if [[ -L $path ]]; then | ||
path=$(_omb_util_readlink "$path") | ||
fi | ||
# Note: In the case of symbolic link, the true binary name can | ||
# contain prefix or suffix for architectures and versions. | ||
path="${path%/*}" | ||
local prefix="${path%/bin}" file | ||
for file in "$prefix"/share/{bash-completion/completions/git,git-core/contrib/completion/git-completion.bash}; do | ||
if [[ -f $file && -r $file && -s $file ]]; then | ||
source "$file" | ||
return $? | ||
fi | ||
done | ||
done | ||
source "$OSH/tools/git-completion.bash" | ||
fi | ||
} | ||
_omb_completion_git_initialize | ||
unset -f _omb_completion_git_initialize |
Oops, something went wrong.