Re: [PATCH 6/8] midx: write multi-pack indices via their source
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Aug 7, 2025, 08:55 UTC
- Message-ID
- <CAOLa=ZTdgra4j-9WbU8nnyQ=38W03MRWbYdJgCGpxnSkumJ9Kg@mail.gmail.com>
- In-Reply-To
- <20250729-b4-pks-midx-deduplicate-source-info-v1-6-748db2eda3b5@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
[snip]
Show 18 quoted lines
> diff --git a/midx-write.c b/midx-write.c
> index 37a0b1682f..bf7c01d4b1 100644
> --- a/midx-write.c
> +++ b/midx-write.c
> @@ -913,15 +913,6 @@ static int write_midx_bitmap(struct write_midx_context *ctx,
> return ret;
> }
>
> -static struct multi_pack_index *lookup_multi_pack_index(struct repository *r,
> - const char *object_dir)
> -{
> - struct odb_source *source = odb_find_source(r->objects, object_dir);
> - if (!source)
> - die(_("could not find object directory matching %s"), object_dir);
> - return get_multi_pack_index(source);
> -}
> -
>Since we now directly pass the source, there is no need to find it from the repository. Makes sense.
[snip]
The rest of the patch, simply replaces the 'repository' object with the 'odb_source' object. This makes things a lot more contained and is indeed a much nicer flow of information.