]> git.ipfire.org Git - thirdparty/git.git/commit
fsck: add a unified interface for reporting fsck messages
authorshejialuo <shejialuo@gmail.com>
Thu, 8 Aug 2024 11:26:57 +0000 (19:26 +0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Aug 2024 16:36:52 +0000 (09:36 -0700)
commit3473d18fad56b40ac3bce457b3779866461cd921
treea38f00818fe941f723a6cdb3a66b752357eee5f2
parent0ec5dfe8c45be2efd6350b3a1a3885c795a85578
fsck: add a unified interface for reporting fsck messages

The static function "report" provided by "fsck.c" aims at checking error
type and calling the callback "error_func" to report the message. Both
refs and objects need to check the error type of the current fsck
message. In order to extract this common behavior, create a new function
"fsck_vreport". Instead of using "...", provide "va_list" to allow more
flexibility.

Instead of changing "report" prototype to be align with the
"fsck_vreport" function, we leave the "report" prototype unchanged due
to the reason that there are nearly 62 references about "report"
function. Simply change "report" function to use "fsck_vreport" to
report objects related messages.

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