1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-03 05:35:58 +00:00

Merge pull request #8516 from ThomasWaldmann/fix-compress-entry

compress_entry: fix assertion failure
This commit is contained in:
TW 2024-11-03 00:16:42 +01:00 committed by GitHub
commit bef9595463
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -397,7 +397,10 @@ def compress_entry(self, entry):
cie = self.chunks.get(id) cie = self.chunks.get(id)
assert cie is not None assert cie is not None
assert cie.flags & ChunkIndex.F_USED assert cie.flags & ChunkIndex.F_USED
assert size == cie.size if cie.size == 0: # size is not known in the chunks index yet
self.chunks[id] = cie._replace(size=size)
else:
assert size == cie.size, f"{size} != {cie.size}"
idx = self.chunks.k_to_idx(id) idx = self.chunks.k_to_idx(id)
compressed_chunks.append(idx) compressed_chunks.append(idx)
entry = entry._replace(chunks=compressed_chunks) entry = entry._replace(chunks=compressed_chunks)