1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-10 09:49:17 +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) match_ignore_pattern.append(path)
# remove negative match # remove negative match
neg_ignore_cnt = 0
for pattern in neg_ignores: for pattern in neg_ignores:
# remove '!' # remove '!'
pattern = pattern[1:] pattern = pattern[1:]
neg_ignore_cnt += 1
if not _match_ignore_pattern(path, pattern): if not _match_ignore_pattern(path, pattern):
if debug: if debug:
msg = f'negative ignore \"{pattern}\" NO match: {path}' msg = f'negative ignore \"{pattern}\" NO match: {path}'
@@ -265,7 +267,7 @@ def _must_ignore(path, ignores, neg_ignores, debug=False):
LOG.warn(warn) LOG.warn(warn)
if len(match_ignore_pattern) < 1: if len(match_ignore_pattern) < 1:
return False return False
if os.path.isdir(path): if os.path.isdir(path) and neg_ignore_cnt > 0:
# this ensures whoever calls this function will # this ensures whoever calls this function will
# descend into the directory to explore the possiblity # descend into the directory to explore the possiblity
# of a file matching the non-ignore pattern # of a file matching the non-ignore pattern