Re: [PATCH v2] [Outreachy Patch] prune-packed: remove USE_THE_REPOSITORY_VARIABLE
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 23, 2026, 07:02 UTC
- Message-ID
- <atsGfWzCMW0LMHNX@pks.im>
- In-Reply-To
- <pull.2266.v2.git.1792428811100.gitgitgadget@gmail.com>
On Mon, Oct 19, 2026 at 04:53:31PM +0000, Shashank S via GitGitGadget wrote:
Show 11 quoted lines
> Range-diff vs v1: > > 1: 5d9ba0cf3a ! 1: 6b583e1d46 prune-packed: remove USE_THE_REPOSITORY_VARIABLE > @@ > ## Metadata ## > -Author: Shashank <shashu8660@gmail.com> > +Author: Shashank S Mogaveera <shashu8660@gmail.com> > > ## 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 10 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 6 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.
Thanks!
Patrick