From: Patrick Steinhardt Date: Fri, 23 Oct 2026 07:02:21 GMT Subject: Re: [PATCH v2] [Outreachy Patch] prune-packed: remove USE_THE_REPOSITORY_VARIABLE Message-ID: In-Reply-To: On Mon, Oct 19, 2026 at 04:53:31PM +0000, Shashank S via GitGitGadget wrote: > Range-diff vs v1: > > 1: 5d9ba0cf3a ! 1: 6b583e1d46 prune-packed: remove USE_THE_REPOSITORY_VARIABLE > @@ > ## Metadata ## > -Author: Shashank > +Author: Shashank S Mogaveera > > ## 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. > - 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. > - 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