builtin/pack-objects: make hash agnostic
Avoid hard-coding a hash size, instead preferring to use the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Feb 22, 2020 at 20:17 UTC
207899137dd75916f65bb9988ccf0559760427d6
1 file changed
+1
-1
builtin/pack-objects.c
+1
-1
@@ -879,7 +879,7 @@ static void write_reused_pack_one(size_t pos, struct hashfile *out,
879
len = encode_in_pack_object_header(header, sizeof(header),
880
OBJ_REF_DELTA, size);
881
hashwrite(out, header, len);
882
- hashwrite(out, base_sha1, 20);
882
+ hashwrite(out, base_sha1, the_hash_algo->rawsz);
883
copy_pack_data(out, reuse_packfile, w_curs, cur, next - cur);
884
return;
885
}