Fix filtering when there's both a Glob and a NotGlob match

This commit is contained in:
Félix Saparelli 2021-12-24 02:19:58 +13:00
parent f19dbf945d
commit 8f9492a7bc
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 4 additions and 4 deletions

View File

@ -172,12 +172,12 @@ impl TaggedFilterer {
} {
Match::None => {
trace!("no match (fail)");
tag_match = false;
tag_match &= false;
}
Match::Ignore(glob) => {
if glob.from().map_or(true, |f| path.strip_prefix(f).is_ok()) {
trace!(?glob, "positive match (pass)");
tag_match = true;
tag_match &= true;
} else {
trace!(?glob, "positive match, but not in scope (ignore)");
}
@ -200,12 +200,12 @@ impl TaggedFilterer {
} {
Match::None => {
trace!("no match (pass)");
tag_match = true;
tag_match &= true;
}
Match::Ignore(glob) => {
if glob.from().map_or(true, |f| path.strip_prefix(f).is_ok()) {
trace!(?glob, "positive match (fail)");
tag_match = false;
tag_match &= false;
} else {
trace!(?glob, "positive match, but not in scope (ignore)");
}