File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -299,18 +299,24 @@ __git_index_file_list_filter ()
299
299
# the second argument.
300
300
__git_ls_files_helper ()
301
301
{
302
- # NOTE: $2 is not quoted in order to support multiple options
303
- cd " $1 " && git ls-files --exclude-standard $2
304
- } 2> /dev/null
302
+ (
303
+ test -n " ${CDPATH+set} " && unset CDPATH
304
+ # NOTE: $2 is not quoted in order to support multiple options
305
+ cd " $1 " && git ls-files --exclude-standard $2
306
+ ) 2> /dev/null
307
+ }
305
308
306
309
307
310
# Execute git diff-index, returning paths relative to the directory
308
311
# specified in the first argument, and using the tree object id
309
312
# specified in the second argument.
310
313
__git_diff_index_helper ()
311
314
{
312
- cd " $1 " && git diff-index --name-only --relative " $2 "
313
- } 2> /dev/null
315
+ (
316
+ test -n " ${CDPATH+set} " && unset CDPATH
317
+ cd " $1 " && git diff-index --name-only --relative " $2 "
318
+ ) 2> /dev/null
319
+ }
314
320
315
321
# __git_index_files accepts 1 or 2 arguments:
316
322
# 1: Options to pass to ls-files (required).
You can’t perform that action at this time.
0 commit comments