From: Shashank S Date: Mon, 19 Oct 2026 16:38:54 GMT Subject: Re: [PATCH] prune-packed: remove USE_THE_REPOSITORY_VARIABLE Message-ID: In-Reply-To: On Mon, 19 Oct 2026 at 12:39, Patrick Steinhardt wrote: > > On Sun, Oct 18, 2026 at 04:31:12PM +0000, Shashank S via GitGitGadget wrote: > > Right now, the prune_packed_objects() function uses the global > > Nit: we typically refrain from saying "now", as it's implicitly clear > that you're describing the status quo in your commit message unless you > explicitly refer to an older commit. thank you for the review and point the mistakes i have done i will correct all the mistake and i will submit the changed commit in the V2 patch. > > in these files, we can safely remove the UNUSED macro from them. > > The question isn't really whether we can safely remove the UNUSED macro. > The question is rather whether we can assume that `repo` always points > to a proper repository. And for that you need to research whether these > commands can be invoked outside of a repository, because if so the repo > may be `NULL`. > I have checked git.c file in that file I went through this commands . prune , prune-packed and repack which are . { "prune", cmd_prune, RUN_SETUP }, { "prune-packed", cmd_prune_packed, RUN_SETUP }, { "repack", cmd_repack, RUN_SETUP }, All this commands are all registered with a special flags ' RUN_SETUP'. This flags search for .git folder . If it finds a .git folder Git successfully initializes the repo struct and passes that to valid pointer to your builtin . If it does not find a .git folder (if they ran it outside the repository) Git immediately stops and shows the error . It never run the code . > > finally, drop the USE_THE_REPOSITORY_VARIABLE macro from > > s/finally/Finally i will change this too. > > > prune-packed.c. > > > > Signed-off-by: Shashank > > We typically ask contributors to spell out their full name, see > Documentation/SubmittingPatches [[real-name]]. > > The changes all look sensible to me, thanks! > > Patrick Thank you