Skip to content

contrib/completion: use __git() in bash completor to avoid aliased tools #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ __git_find_repo_path ()
fi

if [ -n "${__git_C_args-}" ]; then
__git_repo_path="$(git "${__git_C_args[@]}" \
__git_repo_path="$(__git "${__git_C_args[@]}" \
${__git_dir:+--git-dir="$__git_dir"} \
rev-parse --absolute-git-dir 2>/dev/null)"
elif [ -n "${__git_dir-}" ]; then
Expand All @@ -67,7 +67,7 @@ __git_find_repo_path ()
elif [ -d .git ]; then
__git_repo_path=.git
else
__git_repo_path="$(git rev-parse --git-dir 2>/dev/null)"
__git_repo_path="$(__git rev-parse --git-dir 2>/dev/null)"
fi
}

Expand Down Expand Up @@ -379,7 +379,7 @@ fi

# This function is equivalent to
#
# __gitcomp "$(git xxx --git-completion-helper) ..."
# __gitcomp "$(__git xxx --git-completion-helper) ..."
#
# except that the output is cached. Accept 1-3 arguments:
# 1: the git command to execute, this is also the cache key
Expand Down Expand Up @@ -1240,7 +1240,7 @@ _git_archive ()
{
case "$cur" in
--format=*)
__gitcomp "$(git archive --list)" "" "${cur##--format=}"
__gitcomp "$(__git archive --list)" "" "${cur##--format=}"
return
;;
--remote=*)
Expand Down Expand Up @@ -2185,7 +2185,7 @@ __git_config_vars=
__git_compute_config_vars ()
{
test -n "$__git_config_vars" ||
__git_config_vars="$(git help --config-for-completion | sort | uniq)"
__git_config_vars="$(__git help --config-for-completion | sort | uniq)"
}

_git_config ()
Expand Down