Skip to content

do not glob a path if it exists 'unglobbed' #797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use abs_path.replace(rs, '')
  • Loading branch information
sdementen authored Jan 14, 2019
commit ea766c5e01694eee818552fe52ab42481e85ae4f
5 changes: 3 additions & 2 deletions git/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,11 @@ def raise_exc(e):
# end check symlink

# if abs_path exists and is a file, yield it
if os.path.exists(abs_path) and os.path.isfile(abs_path) and False:
if os.path.exists(abs_path) and os.path.isfile(abs_path):
# even if the path contains special characters like ?*[ (glob)
# if it exists, we take it
yield abs_path
yield abs_path.replace(rs, '')

# resolve globs if possible
if '?' in path or '*' in path or '[' in path:
resolved_paths = glob.glob(abs_path)
Expand Down