File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -281,16 +281,12 @@ __gitcomp_file ()
281281# argument, and using the options specified in the second argument.
282282__git_ls_files_helper ()
283283{
284- (
285- test -n " ${CDPATH+set} " && unset CDPATH
286- cd " $1 "
287- if [ " $2 " == " --committable" ]; then
288- git diff-index --name-only --relative HEAD
289- else
290- # NOTE: $2 is not quoted in order to support multiple options
291- git ls-files --exclude-standard $2
292- fi
293- ) 2> /dev/null
284+ if [ " $2 " == " --committable" ]; then
285+ git -C " $1 " diff-index --name-only --relative HEAD
286+ else
287+ # NOTE: $2 is not quoted in order to support multiple options
288+ git -C " $1 " ls-files --exclude-standard $2
289+ fi 2> /dev/null
294290}
295291
296292
@@ -522,7 +518,7 @@ __git_complete_index_file ()
522518 ;;
523519 esac
524520
525- __gitcomp_file " $( __git_index_files " $1 " " $pfx " ) " " $pfx " " $cur_ "
521+ __gitcomp_file " $( __git_index_files " $1 " ${pfx : + " $pfx " } ) " " $pfx " " $cur_ "
526522}
527523
528524__git_complete_file ()
You can’t perform that action at this time.
0 commit comments