Re: [PATCH 05/19] object-file: get rid of `the_repository` when freshening objects
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jul 11, 2025, 09:59 UTC
- Message-ID
- <CAOLa=ZTKLf5EsYGRckxWF1MLARYRdiPZh6ZJ8gYKaMxwBLkqUw@mail.gmail.com>
- In-Reply-To
- <20250709-pks-object-file-wo-the-repository-v1-5-62627b55707f@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 21 quoted lines
> 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 <ps@pks.im>
> ---
> 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]