From 26d382ef22e4aca0e1692577e08aa47904d9d97b Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sat, 16 Sep 2023 13:57:25 +0200 Subject: [PATCH] fix #405 --- dotdrop/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dotdrop/utils.py b/dotdrop/utils.py index 28e817e..8193678 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -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