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

Merge pull request #3163 from ThomasWaldmann/fix-recreate-part-size

borg recreate: correctly compute part file sizes, fixes #3157
TW 7 жил өмнө
parent
commit
6096ff9ad6

+ 3 - 1
src/borg/archive.py

@@ -965,7 +965,9 @@ class ChunksProcessor:
         length = len(item.chunks)
         length = len(item.chunks)
         # the item should only have the *additional* chunks we processed after the last partial item:
         # the item should only have the *additional* chunks we processed after the last partial item:
         item.chunks = item.chunks[from_chunk:]
         item.chunks = item.chunks[from_chunk:]
-        item.get_size(memorize=True)
+        # for borg recreate, we already have a size member in the source item (giving the total file size),
+        # but we consider only a part of the file here, thus we must recompute the size from the chunks:
+        item.get_size(memorize=True, from_chunks=True)
         item.path += '.borg_part_%d' % number
         item.path += '.borg_part_%d' % number
         item.part = number
         item.part = number
         number += 1
         number += 1