浏览代码

Merge pull request #7695 from ThomasWaldmann/fix-4110-master

extract: fix false warning about pattern never matching, fixes #4110
TW 1 年之前
父节点
当前提交
c3cc33fd27
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/borg/patterns.py

+ 4 - 2
src/borg/patterns.py

@@ -125,8 +125,10 @@ 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."""