mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 22:04:44 +00:00
fix #405
This commit is contained in:
@@ -244,9 +244,11 @@ def _must_ignore(path, ignores, neg_ignores, debug=False):
|
||||
match_ignore_pattern.append(path)
|
||||
|
||||
# remove negative match
|
||||
neg_ignore_cnt = 0
|
||||
for pattern in neg_ignores:
|
||||
# remove '!'
|
||||
pattern = pattern[1:]
|
||||
neg_ignore_cnt += 1
|
||||
if not _match_ignore_pattern(path, pattern):
|
||||
if debug:
|
||||
msg = f'negative ignore \"{pattern}\" NO match: {path}'
|
||||
@@ -265,7 +267,7 @@ def _must_ignore(path, ignores, neg_ignores, debug=False):
|
||||
LOG.warn(warn)
|
||||
if len(match_ignore_pattern) < 1:
|
||||
return False
|
||||
if os.path.isdir(path):
|
||||
if os.path.isdir(path) and neg_ignore_cnt > 0:
|
||||
# this ensures whoever calls this function will
|
||||
# descend into the directory to explore the possiblity
|
||||
# of a file matching the non-ignore pattern
|
||||
|
||||
Reference in New Issue
Block a user