Skip to content

Commit 0420b01

Browse files
committed
Only resolve globs if path does not exist on disk
Fixes #994
1 parent d39bd53 commit 0420b01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎git/index/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ def raise_exc(e):
373373
continue
374374
# end check symlink
375375

376-
# resolve globs if possible
377-
if '?' in path or '*' in path or '[' in path:
376+
# if the path is not already pointing to an existing file, resolve globs if possible
377+
if not os.path.exists(path) and ('?' in path or '*' in path or '[' in path):
378378
resolved_paths = glob.glob(abs_path)
379379
# not abs_path in resolved_paths:
380380
# a glob() resolving to the same path we are feeding it with

0 commit comments

Comments
 (0)