ソースを参照

fixup: improve comment about assumptions in the item metadata stream chunker

Thomas Waldmann 4 年 前
コミット
6dc334422e
1 ファイル変更3 行追加2 行削除
  1. 3 2
      src/borg/archive.py

+ 3 - 2
src/borg/archive.py

@@ -337,8 +337,9 @@ class ChunkBuffer:
         self.buffer.seek(0)
         # The chunker returns a memoryview to its internal buffer,
         # thus a copy is needed before resuming the chunker iterator.
-        # note: this is the items metadata stream chunker, we only will get CH_DATA allocation here,
-        #       thus chunk.data will always be data bytes.
+        # note: this is the items metadata stream chunker, we only will get CH_DATA allocation here (because there are,
+        #       no all-zero chunks in a metadata stream), thus chunk.data will always be bytes/memoryview and allocation
+        #       is always CH_DATA and never CH_ALLOC/CH_HOLE).
         chunks = list(bytes(chunk.data) for chunk in self.chunker.chunkify(self.buffer))
         self.buffer.seek(0)
         self.buffer.truncate(0)