summaryrefslogtreecommitdiff
path: root/object-file.c
diff options
context:
space:
mode:
authorshejialuo <shejialuo@gmail.com>2024-08-08 19:26:47 +0800
committerJunio C Hamano <gitster@pobox.com>2024-08-08 09:36:52 -0700
commit0ec5dfe8c45be2efd6350b3a1a3885c795a85578 (patch)
tree3ff59262b6e68189c98e5cd3029323f5b00d2ae8 /object-file.c
parent8cd4a447b8b022a25e05653eb5f2dd80b9009bbe (diff)
fsck: make "fsck_error" callback generic
The "fsck_error" callback is designed to report the objects-related error messages. It accepts two parameter "oid" and "object_type" which is not generic. In order to provide a unified callback which can report either objects or refs, remove the objects-related parameters and add the generic parameter "void *fsck_report". Create a new "fsck_object_report" structure which incorporates the removed parameters "oid" and "object_type". Then change the corresponding references to adapt to new "fsck_error" callback. 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>
Diffstat (limited to 'object-file.c')
-rw-r--r--object-file.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/object-file.c b/object-file.c
index 065103be3e..05ac6ebed6 100644
--- a/object-file.c
+++ b/object-file.c
@@ -2470,11 +2470,10 @@ int repo_has_object_file(struct repository *r,
* give more context.
*/
static int hash_format_check_report(struct fsck_options *opts UNUSED,
- const struct object_id *oid UNUSED,
- enum object_type object_type UNUSED,
- enum fsck_msg_type msg_type UNUSED,
- enum fsck_msg_id msg_id UNUSED,
- const char *message)
+ void *fsck_report UNUSED,
+ enum fsck_msg_type msg_type UNUSED,
+ enum fsck_msg_id msg_id UNUSED,
+ const char *message)
{
error(_("object fails fsck: %s"), message);
return 1;