Skip to content

Commit d8564b9

Browse files
committed
repository: make N=1 chunk size assumption explicit in list(), refs #8572
info.size is the on-disk pack file size, which equals the chunk size only when N=1 (one chunk per pack). Extract it into a named variable with a comment so the assumption is visible and easy to fix when N>1 is introduced.
1 parent a4eac0b commit d8564b9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/borg/repository.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ def list(self, limit=None, marker=None):
467467
pack_id = hex_to_bin(info.name)
468468
chunk_id = pack_id # N=1: chunk_id == pack_id
469469
if collect:
470-
result.append((chunk_id, info.size))
470+
chunk_size = info.size # only correct for N=1
471+
result.append((chunk_id, chunk_size))
471472
if len(result) == limit:
472473
break
473474
elif chunk_id == marker:

0 commit comments

Comments
 (0)