]> git.ipfire.org Git - thirdparty/git.git/commit
hash: add a function to finalize object IDs
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 26 Apr 2021 01:02:52 +0000 (01:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Apr 2021 07:31:38 +0000 (16:31 +0900)
commitab795f0d77aec52496557eb69a5fc9e4f60ea1fd
tree78a5e3451fac3e53b12364f4f8c5c854da318e84
parentc3b4e4ee366b8de9802fa752d0a81be92e690e17
hash: add a function to finalize object IDs

To avoid the penalty of having to branch in hash comparison functions,
we'll want to always compare the full hash member in a struct object_id,
which will require that SHA-1 object IDs be zero-padded.  To do so, add
a function which finalizes a hash context and writes it into an object
ID that performs this padding.

Move the definition of struct object_id and the constant definitions
higher up so we they are available for us to use.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
hash.h
object-file.c