From: Karthik Nayak Date: Fri, 11 Jul 2025 09:59:15 GMT Subject: Re: [PATCH 05/19] object-file: get rid of `the_repository` when freshening objects Message-ID: In-Reply-To: <20250709-pks-object-file-wo-the-repository-v1-5-62627b55707f@pks.im> Patrick Steinhardt writes: > We implicitly depend on `the_repository` when freshening either loose or > packed objects. Refactor these functions to instead accept an object > database as input so that we can get rid of the global dependency. > > Signed-off-by: Patrick Steinhardt > --- > object-file.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/object-file.c b/object-file.c > index 9e17e608f78..3453989b7e3 100644 > --- a/object-file.c > +++ b/object-file.c > @@ -893,23 +893,21 @@ static int write_loose_object(const struct object_id *oid, char *hdr, > FOF_SKIP_COLLISION_CHECK); > } > > -static int freshen_loose_object(const struct object_id *oid) > +static int freshen_loose_object(struct object_database *odb, > + const struct object_id *oid) > { So for functions which only work on object database source, we add a '_source' suffix. For others, it is expected to work on the database level. Ok. [snip]