Browse Source

recreate: fix rechunking dropping all chunks on the floor

Marian Beermann 8 years ago
parent
commit
eb940e6779
2 changed files with 2 additions and 1 deletions
  1. 1 1
      src/borg/archive.py
  2. 1 0
      src/borg/testsuite/archiver.py

+ 1 - 1
src/borg/archive.py

@@ -1528,7 +1528,7 @@ class ArchiveRecreater:
             # The target.chunker will read the file contents through ChunkIteratorFileWrapper chunk-by-chunk
             # (does not load the entire file into memory)
             file = ChunkIteratorFileWrapper(chunk_iterator)
-            return target.chunker.chunkify(file)
+            yield from target.chunker.chunkify(file)
         else:
             for chunk in chunk_iterator:
                 yield chunk.data

+ 1 - 0
src/borg/testsuite/archiver.py

@@ -1823,6 +1823,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
         self.cmd('recreate', self.repository_location, '--chunker-params', 'default')
         self.check_cache()
         # test1 and test2 do deduplicate after recreate
+        assert int(self.cmd('list', self.repository_location + '::test1', 'input/large_file', '--format={size}'))
         assert not int(self.cmd('list', self.repository_location + '::test1', 'input/large_file',
                                 '--format', '{unique_chunks}'))