From: Shreyansh Paliwal Date: Tue, 03 Feb 2026 15:20:03 GMT Subject: Re: [PATCH 1/3] wt-status: replace uses of the_repository with local repository instances Message-ID: <20260203152007.38187-1-shreyanshpaliwalcmsmn@gmail.com> In-Reply-To: > On 03/02/2026 09:53, Shreyansh Paliwal wrote: > >> > >> Clarification. This function is like an initializer for the struct > >> wt_status instance at 's', so it has to take both "struct repository" > >> parameter, but what I meant was other wt_status_foo() functions that > >> take both r and s as parameters. Once s has been initialized and > >> s->repo becomes valid, passing r as a separate parameter, as if you > >> can feed a different instance of "struct repo", becomes confusing > >> and a source of bugs. > > > > Actually wt_status_prepare() is the only function which is taking both > > struct wt_status *s and struct repository *r, because it has to initialize > > 's' with the help of 'r'. > > But all the other wt_status_.. helper functions only take one of the following, > > i.e. either they take struct wt_status *s which is fine, or they take > > struct repository *r. > > You're correct, but I had the same reaction as Junio initially as I was > confused by the functions that take a "struct repository" and "struct > wt_status_state" which does not contain a repository, but at first > glance looks a lot like "struct wt_status" which does. Ah, got it. Even I got confused by this once :)