mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
Merge branch 'jc/completion-no-chdir'
* jc/completion-no-chdir: completion: use "git -C $there" instead of (cd $there && git ...)
This commit is contained in:
commit
98349e5364
@ -281,16 +281,12 @@ __gitcomp_file ()
|
||||
# argument, and using the options specified in the second argument.
|
||||
__git_ls_files_helper ()
|
||||
{
|
||||
(
|
||||
test -n "${CDPATH+set}" && unset CDPATH
|
||||
cd "$1"
|
||||
if [ "$2" == "--committable" ]; then
|
||||
git diff-index --name-only --relative HEAD
|
||||
else
|
||||
# NOTE: $2 is not quoted in order to support multiple options
|
||||
git ls-files --exclude-standard $2
|
||||
fi
|
||||
) 2>/dev/null
|
||||
if [ "$2" == "--committable" ]; then
|
||||
git -C "$1" diff-index --name-only --relative HEAD
|
||||
else
|
||||
# NOTE: $2 is not quoted in order to support multiple options
|
||||
git -C "$1" ls-files --exclude-standard $2
|
||||
fi 2>/dev/null
|
||||
}
|
||||
|
||||
|
||||
@ -522,7 +518,7 @@ __git_complete_index_file ()
|
||||
;;
|
||||
esac
|
||||
|
||||
__gitcomp_file "$(__git_index_files "$1" "$pfx")" "$pfx" "$cur_"
|
||||
__gitcomp_file "$(__git_index_files "$1" ${pfx:+"$pfx"})" "$pfx" "$cur_"
|
||||
}
|
||||
|
||||
__git_complete_file ()
|
||||
|
Loading…
Reference in New Issue
Block a user