]> git.ipfire.org Git - thirdparty/git.git/commit
hash: make `is_null_oid()` independent of `the_repository`
authorPatrick Steinhardt <ps@pks.im>
Fri, 14 Jun 2024 06:50:08 +0000 (08:50 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2024 17:26:33 +0000 (10:26 -0700)
commit861e8c76f6668a8cbb764ec0ea3ba425dfb86b2a
tree31f293d0b31897958e126e6cc98c2424568550aa
parentd4d364b2c7442a1dd5bec8ab818791ec8769c3e9
hash: make `is_null_oid()` independent of `the_repository`

The function `is_null_oid()` uses `oideq(oid, null_oid())` to check
whether a given object ID is the all-zero object ID. `null_oid()`
implicitly relies on `the_repository` though to return the correct null
object ID.

Get rid of this dependency by always comparing the complete hash array
for being all-zeroes. This is possible due to the refactoring of object
IDs so that their hash arrays are always fully initialized.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
hash-ll.h
hash.h