summaryrefslogtreecommitdiff
path: root/pack-bitmap-write.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 00:04:54 +0000
committerJunio C Hamano <gitster@pobox.com>2019-04-01 11:57:37 +0900
commit0f4d6cada83dc6bd6b6b24dc0d2b3e6460c645cb (patch)
tree1f2f29232c58ef66350f6c8eef4fae77a35b8fd4 /pack-bitmap-write.c
parent5a8643eff1e59f1cf96da9875d5716e88f480710 (diff)
downloadgit-0f4d6cada83dc6bd6b6b24dc0d2b3e6460c645cb.tar.gz
pack-bitmap: make bitmap header handling hash agnostic
Increase the checksum field in struct bitmap_disk_header to be GIT_MAX_RAWSZ bytes in length and ensure that we hash the proper number of bytes out when computing the bitmap checksum. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap-write.c')
-rw-r--r--pack-bitmap-write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index 5566e94abe..c82fb01fd7 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -535,7 +535,7 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
header.entry_count = htonl(writer.selected_nr);
hashcpy(header.checksum, writer.pack_checksum);
- hashwrite(f, &header, sizeof(header));
+ hashwrite(f, &header, sizeof(header) - GIT_MAX_RAWSZ + the_hash_algo->rawsz);
dump_bitmap(f, writer.commits);
dump_bitmap(f, writer.trees);
dump_bitmap(f, writer.blobs);