]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/fsck: move generic object ID checks into `refs_fsck()`
authorPatrick Steinhardt <ps@pks.im>
Mon, 12 Jan 2026 09:03:04 +0000 (10:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jan 2026 14:55:41 +0000 (06:55 -0800)
commit46d611cadab500ca2b458b2fda7008c41b174011
tree700e25707d347981e83938f5f6fbc5495728f143
parent06d6ead762ba525c5837812e7f509406253cdacd
builtin/fsck: move generic object ID checks into `refs_fsck()`

While most of the logic that verifies the consistency of refs is
driven by `refs_fsck()`, we still have a small handful of checks in
`fsck_head_link()`. These checks don't use the git-fsck(1) reporting
infrastructure, and as such it's impossible to for example disable
some of those checks.

One such check detects refs that point to the all-zeroes object ID.
Extract this check into the generic `refs_fsck_ref()` function that is
used by both the "files" and "reftable" backends.

Note that this will cause us to not return an error code from
`fsck_head_link()` anymore in case this error was detected. This is fine
though: the only caller of this function does not check the error code
anyway. To demonstrate this, adapt the function to drop its return value
altogether. The function will be removed in a subsequent commit anyway.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/fsck-msgids.adoc
builtin/fsck.c
fsck.h
refs.c
t/t1450-fsck.sh