1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 22:04:44 +00:00
This commit is contained in:
deadc0de6
2023-09-16 13:57:25 +02:00
committed by deadc0de
parent f152e94a73
commit 26d382ef22

View File

@@ -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