Re: [PATCH v2] [Outreachy Patch] prune-packed: remove USE_THE_REPOSITORY_VARIABLE
On Fri, 23 Oct 2026 at 12:32, Patrick Steinhardt <ps@pks.im> wrote:
>
> On Mon, Oct 19, 2026 at 04:53:31PM +0000, Shashank S via
Show 5 quoted lines
> > ## Commit message ##
> > - prune-packed: remove USE_THE_REPOSITORY_VARIABLE
> > + [Outreachy Patch] prune-packed: remove USE_THE_REPOSITORY_VARIABLE
>
> This prefix shouldn't be part of the patch subject itself.
Show 13 quoted lines
>
> > - Right now, the prune_packed_objects() function uses the global
> > + The prune_packed_objects() function uses the global
> > the_repository variable. To help with the libification effort,
> > change this function so it takes a 'struct repository' pointer
> > as an argument instead.
> > @@ Commit message
> > prune_object() callbacks to read from this new struct.
> >
> > Update the builtins that call this function (builtin/prune-packed.c,
> > - builtin/prune.c, and builtin/repack.c) to pass their local `repo`
>
> One small nit: I don't think we need to have the list here.
Show 9 quoted lines
> > - variables. Because we are now actually using the 'repo' parameter
> > - in these files, we can safely remove the UNUSED macro from them.
> > + builtin/prune.c, and builtin/repack.c) to pass their local 'repo'
> > + variables. We can safely remove the UNUSED macro from them because
> > + these commands are all declared with the RUN_SETUP flag in git.c,
> > + which guarantees that the 'repo' pointer will never be NULL.
>
> As mentioned by Junio, this isn't true. The repo pointer _may_ be NULL
> in the case where "-h" is passed.
I will improvise the commit and submit a patch v3
>
> Thanks!
>
> Patrick
Thanks!
Shashank S Mogaveera