Re: [PATCH 1/4] git: pass in repo for RUN_SETUP_GENTLY
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 26, 2024, 16:41 UTC
- Message-ID
- <xmqq1q16l64d.fsf@gitster.g>
- In-Reply-To
- <ZvVumLAFu1LGzXWP@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 11 quoted lines
>> - status = p->fn(argc, argv, prefix, (p->option & RUN_SETUP)? repo : NULL); >> + status = p->fn(argc, >> + argv, >> + prefix, >> + ((p->option & RUN_SETUP) || (p->option & RUN_SETUP_GENTLY))? repo : NULL); >> validate_cache_entries(repo->index); > > Should we really pass `repo` unconditionally when `RUN_SETUP_GENTLY` was > requested? I'd think that we should rather pass `NULL` if we didn't find > a repository in that case. So this condition should likely be made > conditional, shouldn't it?
Yeah, that is much much more preferrable than my earlier suggestion to pass yet another Boolean parameter to p->fn().
> There's also a missing space between the closing brace and the ternary > questionmark.
True, too.