Forráskód Böngészése

extract: small bugfix and optimization for hardlink masters

if a hardlink master is not in the to-be-extracted subset, the "x"
status was not displayed for it.

also, the matcher was called twice for matching items.
Thomas Waldmann 8 éve
szülő
commit
ceaf4a8fcf
1 módosított fájl, 3 hozzáadás és 5 törlés
  1. 3 5
      src/borg/archive.py

+ 3 - 5
src/borg/archive.py

@@ -1614,15 +1614,13 @@ class ArchiveRecreater:
             return (target_is_subset and
                     stat.S_ISREG(item.mode) and
                     item.get('hardlink_master', True) and
-                    'source' not in item and
-                    not matcher.match(item.path))
+                    'source' not in item)
 
         for item in archive.iter_items():
-            if item_is_hardlink_master(item):
-                hardlink_masters[item.path] = (item.get('chunks'), None)
-                continue
             if not matcher.match(item.path):
                 self.print_file_status('x', item.path)
+                if item_is_hardlink_master(item):
+                    hardlink_masters[item.path] = (item.get('chunks'), None)
                 continue
             if target_is_subset and stat.S_ISREG(item.mode) and item.get('source') in hardlink_masters:
                 # master of this hard link is outside the target subset