File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -281,16 +281,12 @@ __gitcomp_file ()
281
281
# argument, and using the options specified in the second argument.
282
282
__git_ls_files_helper ()
283
283
{
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
294
290
}
295
291
296
292
@@ -522,7 +518,7 @@ __git_complete_index_file ()
522
518
;;
523
519
esac
524
520
525
- __gitcomp_file " $( __git_index_files " $1 " " $pfx " ) " " $pfx " " $cur_ "
521
+ __gitcomp_file " $( __git_index_files " $1 " ${pfx : + " $pfx " } ) " " $pfx " " $cur_ "
526
522
}
527
523
528
524
__git_complete_file ()
You can’t perform that action at this time.
0 commit comments