Re: [PATCH v3 4/8] repack: refactor finding pack prefix
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Aug 8, 2023, 08:29 UTC
- Message-ID
- <CAP8UFD0gojKUhZv82d-CVt9nPL+0UWCr+nV7+5_UFykCDuM9WA@mail.gmail.com>
- In-Reply-To
- <ZMBQ97ucRg9gO4gW@nand.local>
On Wed, Jul 26, 2023 at 12:47 AM Taylor Blau <me@ttaylorr.com> wrote:
Show 19 quoted lines
>
> On Mon, Jul 24, 2023 at 10:59:05AM +0200, Christian Couder wrote:
> > diff --git a/builtin/repack.c b/builtin/repack.c
> > index 96af2d1caf..21e3b89f27 100644
> > --- a/builtin/repack.c
> > +++ b/builtin/repack.c
> > @@ -783,6 +783,17 @@ static int write_cruft_pack(const struct pack_objects_args *args,
> > return finish_pack_objects_cmd(&cmd, names, local);
> > }
> >
> > +static const char *find_pack_prefix(void)
> > +{
> > + const char *pack_prefix;
> > + if (!skip_prefix(packtmp, packdir, &pack_prefix))
>
> I wonder if this might be a good opportunity to pass "packtmp" and
> "packdir" as arguments to the function. I know that these are globals,
> but it at least nudges us in the right direction away from adding more
> global variables.I have changed this in the version 4 I just sent. Now "packtmp" and "packdir" are passed as arguments to the function as you suggest. Thanks.