diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-08-16 12:51:51 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-16 12:51:51 -0700 |
| commit | b3d175409d9bfe005515ffe361e959fb9965111c (patch) | |
| tree | 3227deea0e3191061f9b742687957adfb1ff3897 /builtin/fsck.c | |
| parent | 87a1768b93a67d0420255a43d9e07387b2e805ad (diff) | |
| parent | 1c31be45b3b263670c7d2a91c27cc119b77dd2e2 (diff) | |
| download | git-b3d175409d9bfe005515ffe361e959fb9965111c.tar.xz | |
Merge branch 'sj/ref-fsck'
"git fsck" infrastructure has been taught to also check the sanity
of the ref database, in addition to the object database.
* sj/ref-fsck:
fsck: add ref name check for files backend
files-backend: add unified interface for refs scanning
builtin/refs: add verify subcommand
refs: set up ref consistency check infrastructure
fsck: add refs report function
fsck: add a unified interface for reporting fsck messages
fsck: make "fsck_error" callback generic
fsck: rename objects-related fsck error functions
fsck: rename "skiplist" to "skip_oids"
Diffstat (limited to 'builtin/fsck.c')
| -rw-r--r-- | builtin/fsck.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c index ef6ee1268b..ef014bbbcd 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -89,13 +89,16 @@ static int objerror(struct object *obj, const char *err) return -1; } -static int fsck_error_func(struct fsck_options *o UNUSED, - const struct object_id *oid, - enum object_type object_type, - enum fsck_msg_type msg_type, - enum fsck_msg_id msg_id UNUSED, - const char *message) +static int fsck_objects_error_func(struct fsck_options *o UNUSED, + void *fsck_report, + enum fsck_msg_type msg_type, + enum fsck_msg_id msg_id UNUSED, + const char *message) { + struct fsck_object_report *report = fsck_report; + const struct object_id *oid = report->oid; + enum object_type object_type = report->object_type; + switch (msg_type) { case FSCK_WARN: /* TRANSLATORS: e.g. warning in tree 01bfda: <more explanation> */ @@ -938,7 +941,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) fsck_walk_options.walk = mark_object; fsck_obj_options.walk = mark_used; - fsck_obj_options.error_func = fsck_error_func; + fsck_obj_options.error_func = fsck_objects_error_func; if (check_strict) fsck_obj_options.strict = 1; |
