From 07825cd496c92139378ffd403b514db333bfbc71 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 22 Oct 2021 21:10:22 +0200 Subject: [PATCH] git.PackWriter: assert on no precalculated sha We really don't have any code path getting here without a sha, so don't try to make up for it if it's missing, just assert. Signed-off-by: Johannes Berg Reviewed-by: Rob Browning Tested-by: Rob Browning --- lib/bup/git.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/bup/git.py b/lib/bup/git.py index 5d46cc7..f7ff94b 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -855,8 +855,7 @@ class PackWriter(object): def _write(self, sha, type, content): if verbose: log('>') - if not sha: - sha = calc_hash(type, content) + assert sha size, crc = self._raw_write(_encode_packobj(type, content, self.compression_level), sha=sha) -- 2.39.2