We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8591a0 commit 86ceb96Copy full SHA for 86ceb96
git/index/base.py
@@ -377,8 +377,13 @@ def raise_exc(e):
377
continue
378
# end check symlink
379
380
- # resolve globs if possible
381
- if '?' in path or '*' in path or '[' in path:
+ # if abs_path exists, yield it, otherwise resolve globs if possible
+ if os.path.exists(abs_path):
382
+ # even if the path contains special characters like ?*[ (glob)
383
+ # if it exists, we take it as such and do not try to resolve globs
384
+ yield abs_path
385
+ # otherwise resolve globs if possible
386
+ elif '?' in path or '*' in path or '[' in path:
387
resolved_paths = glob.glob(abs_path)
388
# not abs_path in resolved_paths:
389
# a glob() resolving to the same path we are feeding it with
0 commit comments