]> git.ipfire.org Git - thirdparty/git.git/commit
fsck: add refs report function
authorshejialuo <shejialuo@gmail.com>
Thu, 8 Aug 2024 11:27:08 +0000 (19:27 +0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Aug 2024 16:36:52 +0000 (09:36 -0700)
commit2de307cdb2e80840b1fe6741561fed7c99fd8f08
tree19855ce28845c66b1ecba0746aa4f4078f09a377
parent3473d18fad56b40ac3bce457b3779866461cd921
fsck: add refs report function

Introduce a new struct "fsck_ref_report" to contain the information we
need when reporting refs-related messages.

With the new "fsck_vreport" function, add a new function
"fsck_report_ref" to report refs-related fsck error message. Unlike
"report" function uses the exact parameters, we simply pass "struct
fsck_ref_report *report" as the parameter. This is because at current we
don't know exactly how many fields we need. By passing this parameter,
we don't need to change this function prototype when we want to add more
information into "fsck_ref_report".

We have introduced "fsck_report_ref" function to report the error
message for refs. We still need to add the corresponding callback
function. Create refs-specific "error_func" callback
"fsck_refs_error_function".

Last, add "FSCK_REFS_OPTIONS_DEFAULT" macro to create default options
when checking ref consistency.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsck.c
fsck.h