From: Junio C Hamano Date: Thu, 26 Sep 2024 16:41:38 GMT Subject: Re: [PATCH 1/4] git: pass in repo for RUN_SETUP_GENTLY Message-ID: In-Reply-To: Patrick Steinhardt writes: >> - 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.