]> git.ipfire.org Git - thirdparty/git.git/commit
refs/files: improve error handling when verifying symrefs
authorPatrick Steinhardt <ps@pks.im>
Mon, 12 Jan 2026 09:02:55 +0000 (10:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jan 2026 14:55:40 +0000 (06:55 -0800)
commit9ebccf744a967f399579a3f3ffbeb40120f5a1e1
tree0cbfae155c6c8dc8a11b449fe3c6821b8d50bee6
parent0ff9cf40b2ce3df2f6eda0875eb54fe3c3487f5b
refs/files: improve error handling when verifying symrefs

The error handling when verifying symbolic refs is a bit on the wild
side:

  - `fsck_report_ref()` can be told to ignore specific errors. If an
    error has been ignored and a previous check raised an unignored
    error, then assigning `ret = fsck_report_ref()` will cause us to
    swallow the previous error.

  - When the target reference is not valid we bail out early without
    checking for other errors.

Fix both of these issues by consistently or'ing the return value and not
bailing out early.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c