Re: [PATCH] builtin: replace the_repository parameter in is_bare_repository()
- From
Hardik Kumar <hardikxk@gmail.com>
- Date
- Aug 27, 2026, 19:56 UTC
- Message-ID
- <DKZZOTND7RNF.16J4VLMEKOMLM@gmail.com>
- In-Reply-To
- <xmqqo6en8jof.fsf@gitster.g>
On Fri Aug 28, 2026 at 12:39 AM IST, Junio C Hamano wrote:
Show 9 quoted lines
>> The patch leaves some instances of this case that would require >> additional changes rather than simply replacing the arguments passed to >> the function call. >> >> - Only update sites that do not introduce any functional changes. > > How did you make sure that the places touched by this patch do not? > > How do you deal with repo==NULL case in these code paths?
I verified by running the entire test suite which passed fine. In addition to that the methods in `repository.c` should already handle such a case if the `repo` were to ever be NULL or not initialized as the same pointer is what is passed to all callers.
Also the repo should always be NOT NULL and then git just throws an error about the inexistence of it.