Subject: Re: [PATCH 01/14] fsck: drop `the_repository` in `fsck_walk()`

From: Junio C Hamano <[email-masked]>
Date: Fri, 20 Mar 2026 16:09:24 -0700

Patrick Steinhardt <[email-masked]> writes:

> The function `fsck_walk()` and its object type specific functions
> `fsck_walk_tree()` et al implicitly rely on `the_repository`. Remove
> this dependency by injecting the repository as a parameter instead.
>
> Signed-off-by: Patrick Steinhardt <[email-masked]>
> ---
>  builtin/fsck.c           |  6 +++---
>  builtin/index-pack.c     |  2 +-
>  builtin/unpack-objects.c |  2 +-
>  fsck.c                   | 40 ++++++++++++++++++++++++++--------------
>  fsck.h                   | 15 ++++++++++++---
>  5 files changed, 43 insertions(+), 22 deletions(-)

OK.

While the conversion is cleanly done, the resulting code makes me
wonder if fsck_options struct

        struct fsck_options {
                fsck_walk_func walk;
                fsck_error error_func;
                unsigned strict;
                unsigned verbose;
                enum fsck_msg_type *msg_type;
                struct oidset skip_oids;
                struct oidset gitmodules_found;
                struct oidset gitmodules_done;
                struct oidset gitattributes_found;
                struct oidset gitattributes_done;
                kh_oid_map_t *object_names;
        };

should gain a repository pointer.  After all, these oidset and oidmap
are about objects in one particular repository.