2
0
Эх сурвалжийг харах

recreate: move chunks_healthy when excluding hardlink master, fixes #3228

Thomas Waldmann 7 жил өмнө
parent
commit
7aafcc517a

+ 5 - 3
src/borg/archive.py

@@ -1768,15 +1768,17 @@ class ArchiveRecreater:
             if not matcher.match(item.path):
             if not matcher.match(item.path):
                 self.print_file_status('x', item.path)
                 self.print_file_status('x', item.path)
                 if item_is_hardlink_master(item):
                 if item_is_hardlink_master(item):
-                    hardlink_masters[item.path] = (item.get('chunks'), None)
+                    hardlink_masters[item.path] = (item.get('chunks'), item.get('chunks_healthy'), None)
                 continue
                 continue
             if target_is_subset and hardlinkable(item.mode) and item.get('source') in hardlink_masters:
             if target_is_subset and hardlinkable(item.mode) and item.get('source') in hardlink_masters:
                 # master of this hard link is outside the target subset
                 # master of this hard link is outside the target subset
-                chunks, new_source = hardlink_masters[item.source]
+                chunks, chunks_healthy, new_source = hardlink_masters[item.source]
                 if new_source is None:
                 if new_source is None:
                     # First item to use this master, move the chunks
                     # First item to use this master, move the chunks
                     item.chunks = chunks
                     item.chunks = chunks
-                    hardlink_masters[item.source] = (None, item.path)
+                    if chunks_healthy is not None:
+                        item.chunks_healthy = chunks_healthy
+                    hardlink_masters[item.source] = (None, None, item.path)
                     del item.source
                     del item.source
                 else:
                 else:
                     # Master was already moved, only update this item's source
                     # Master was already moved, only update this item's source