builtin/pack-objects: avoid using struct object_id for pack hash
commit71b7672b674bc9a44fb41428804be428c2981046
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 26 Apr 2021 01:02:59 +0000 (26 01:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Apr 2021 07:31:39 +0000 (27 16:31 +0900)
tree71f63e2870fb81aecf44477be42ce3fcca6499c2
parent72871b132c7c81d23aa9d4467013651c1c51bbc4
builtin/pack-objects: avoid using struct object_id for pack hash

We use struct object_id for the names of objects.  It isn't intended to
be used for other hash values that don't name objects such as the pack
hash.

Because struct object_id will soon need to have its algorithm member
set, using it in this code path would mean that we didn't set that
member, only the hash member, which would result in a crash.  For both
of these reasons, switch to using an unsigned char array of size
GIT_MAX_RAWSZ.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c