Skip to content

Commit 2078991

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 51ebf55 commit 2078991

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static void write_reused_pack_one(size_t pos, struct hashfile *out,
879879
len = encode_in_pack_object_header(header, sizeof(header),
880880
OBJ_REF_DELTA, size);
881881
hashwrite(out, header, len);
882-
hashwrite(out, base_sha1, 20);
882+
hashwrite(out, base_sha1, the_hash_algo->rawsz);
883883
copy_pack_data(out, reuse_packfile, w_curs, cur, next - cur);
884884
return;
885885
}

0 commit comments

Comments
 (0)