Skip to content

Commit

Permalink
Merge pull request #7695 from ThomasWaldmann/fix-4110-master
Browse files Browse the repository at this point in the history
extract: fix false warning about pattern never matching, fixes #4110
  • Loading branch information
ThomasWaldmann committed Jul 1, 2023
2 parents c539b40 + 2aecdb9 commit c3cc33f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/borg/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ def add_includepaths(self, include_paths):
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."""
Expand Down

0 comments on commit c3cc33f

Please sign in to comment.