summaryrefslogtreecommitdiff
path: root/pack-bitmap.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 00:04:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 02:57:37 (GMT)
commit9941e920e0b5a79c5b7859cb59b9ab866a77b25f (patch)
treeca2eb66439a1e489777f214dee2cbdad6e55b87c /pack-bitmap.c
parent0dd4924891664e9e9970e427e84f902491fcd3d3 (diff)
downloadgit-9941e920e0b5a79c5b7859cb59b9ab866a77b25f.zip
git-9941e920e0b5a79c5b7859cb59b9ab866a77b25f.tar.gz
git-9941e920e0b5a79c5b7859cb59b9ab866a77b25f.tar.bz2
pack-bitmap: switch hard-coded constants to the_hash_algo
Switch two hard-coded uses of 20 to references to the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 6d6fa68..603492c 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -138,7 +138,7 @@ static int load_bitmap_header(struct bitmap_index *index)
{
struct bitmap_disk_header *header = (void *)index->map;
- if (index->map_size < sizeof(*header) + 20)
+ if (index->map_size < sizeof(*header) + the_hash_algo->rawsz)
return error("Corrupted bitmap index (missing header data)");
if (memcmp(header->magic, BITMAP_IDX_SIGNATURE, sizeof(BITMAP_IDX_SIGNATURE)) != 0)
@@ -157,7 +157,7 @@ static int load_bitmap_header(struct bitmap_index *index)
"(Git requires BITMAP_OPT_FULL_DAG)");
if (flags & BITMAP_OPT_HASH_CACHE) {
- unsigned char *end = index->map + index->map_size - 20;
+ unsigned char *end = index->map + index->map_size - the_hash_algo->rawsz;
index->hashes = ((uint32_t *)end) - index->pack->num_objects;
}
}