]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/pxar/exclude_pattern.rs: do not return partial matches for files
authorChristian Ebner <c.ebner@proxmox.com>
Tue, 16 Jul 2019 11:19:47 +0000 (13:19 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 17 Jul 2019 07:44:06 +0000 (09:44 +0200)
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 <c.ebner@proxmox.com>
src/pxar/exclude_pattern.rs

index 7a3b3aaaa53ed7bc28a667966db05880a094f096..eb37fbb5797c543d57af5c8d82f3bc2b046310f0 100644 (file)
@@ -174,6 +174,10 @@ impl PxarExcludePattern {
             res = MatchType::None;
         }
 
+        if !is_dir && (res == MatchType::PartialInclude || res == MatchType::PartialExclude) {
+            res = MatchType::None;
+        }
+
         res
     }
 }