From a771f90745544af359b0c61c4dbab6f7ed435483 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Tue, 16 Jul 2019 13:19:47 +0200 Subject: [PATCH] src/pxar/exclude_pattern.rs: do not return partial matches for files Partial matches make only sense for directories, files are always leafs of the tree. Take this into account in order to avoid restoring of files which only matched the front of a match pattern. Signed-off-by: Christian Ebner --- src/pxar/exclude_pattern.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pxar/exclude_pattern.rs b/src/pxar/exclude_pattern.rs index 7a3b3aaa..eb37fbb5 100644 --- a/src/pxar/exclude_pattern.rs +++ b/src/pxar/exclude_pattern.rs @@ -174,6 +174,10 @@ impl PxarExcludePattern { res = MatchType::None; } + if !is_dir && (res == MatchType::PartialInclude || res == MatchType::PartialExclude) { + res = MatchType::None; + } + res } }