Show 21 quoted lines
> 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.