From: brian m. carlson Date: Sat, 22 Feb 2020 20:17:26 +0000 (+0000) Subject: builtin/pack-objects: make hash agnostic X-Git-Tag: v2.27.0-rc0~156^2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=207899137dd75916f65bb9988ccf0559760427d6;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 940fbcb7b3..fceac7b462 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -879,7 +879,7 @@ static void write_reused_pack_one(size_t pos, struct hashfile *out, len = encode_in_pack_object_header(header, sizeof(header), OBJ_REF_DELTA, size); hashwrite(out, header, len); - hashwrite(out, base_sha1, 20); + hashwrite(out, base_sha1, the_hash_algo->rawsz); copy_pack_data(out, reuse_packfile, w_curs, cur, next - cur); return; }