From 0420b01f24d404217210aeac0c730ec95eb7ee69 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 8 Mar 2020 14:08:16 +0800 Subject: Only resolve globs if path does not exist on disk Fixes #994 --- git/index/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/index/base.py') 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 -- cgit v1.2.1