diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-03-08 14:08:16 +0800 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-03-08 14:08:16 +0800 |
commit | 0420b01f24d404217210aeac0c730ec95eb7ee69 (patch) | |
tree | 2c8052a14814932207854afafe9047c062aaa65c | |
parent | d39bd5345af82e3acbdc1ecb348951b05a5ed1f6 (diff) | |
download | gitpython-0420b01f24d404217210aeac0c730ec95eb7ee69.tar.gz |
Only resolve globs if path does not exist on disk
Fixes #994
-rw-r--r-- | git/index/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git/index/base.py b/git/index/base.py index 8ff0f982..2569e3d7 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -373,8 +373,8 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): continue # end check symlink - # resolve globs if possible - if '?' in path or '*' in path or '[' in path: + # if the path is not already pointing to an existing file, resolve globs if possible + if not os.path.exists(path) and ('?' in path or '*' in path or '[' in path): resolved_paths = glob.glob(abs_path) # not abs_path in resolved_paths: # a glob() resolving to the same path we are feeding it with |