Re: [PATCH 41/49] builtin/repack.c: use `write_pack_opts` within `write_cruft_pack()`
- From
Jeff King <peff@peff.net>
- Date
- Oct 15, 2025, 10:29 UTC
- Message-ID
- <20251015102953.GC2250228@coredump.intra.peff.net>
- In-Reply-To
- <7826afc17376f0d4a7f3169d9aafce21b3273ff5.1759097191.git.me@ttaylorr.com>
On Sun, Sep 28, 2025 at 06:09:57PM -0400, Taylor Blau wrote:
Show 7 quoted lines
> -static int write_cruft_pack(const struct pack_objects_args *args, > - const char *destination, > - const char *pack_prefix, > +static int write_cruft_pack(struct write_pack_opts *opts, > const char *cruft_expiration, > unsigned long combine_cruft_below_size, > struct string_list *names,
Following on the comment from the previous commit, I guess with my proposal we'd have to call find_pack_prefix() ourselves here in write_cruft_pack().
OTOH, this call...
Show 11 quoted lines
> @@ -599,6 +597,13 @@ int cmd_repack(int argc,
>
> if (pack_everything & PACK_CRUFT) {
> const char *pack_prefix = find_pack_prefix(packdir, packtmp);
> + struct write_pack_opts opts = {
> + .po_args = &cruft_po_args,
> + .destination = packtmp,
> + .pack_prefix = pack_prefix,
> + .packtmp = packtmp,
> + .packdir = packdir,
> + };...would go away, so I think it is net the same number of lines.
-Peff