summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-02-22 20:17:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-24 17:33:11 (GMT)
commit207899137dd75916f65bb9988ccf0559760427d6 (patch)
treebb6b60b01e7cc2705a5ef5a8a0e816a0246cf08f
parent51ebf55b9309824346a6589c9f3b130c6f371b8f (diff)
downloadgit-207899137dd75916f65bb9988ccf0559760427d6.zip
git-207899137dd75916f65bb9988ccf0559760427d6.tar.gz
git-207899137dd75916f65bb9988ccf0559760427d6.tar.bz2
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>
-rw-r--r--builtin/pack-objects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 940fbcb..fceac7b 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;
}