From f5f5311e2b863fecc820478fd374d54132850149 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 1 Jul 2023 02:05:58 +0200 Subject: [PATCH] extract: fix false warning about pattern never matching, fixes #4110 --- src/borg/patterns.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/borg/patterns.py b/src/borg/patterns.py index 49668ef2b..e57a5f271 100644 --- a/src/borg/patterns.py +++ b/src/borg/patterns.py @@ -131,8 +131,11 @@ class PatternMatcher: self.include_patterns = include_patterns def get_unmatched_include_patterns(self): - "Note that this only returns patterns added via *add_includepaths*." - return [p for p in self.include_patterns if p.match_count == 0] + """Note that this only returns patterns added via *add_includepaths* and it + won't return PathFullPattern patterns as we do not match_count for them. + """ + return [p for p in self.include_patterns + if p.match_count == 0 and not isinstance(p, PathFullPattern)] def add_inclexcl(self, patterns): """Add list of patterns (of type CmdTuple) to internal list.