From: Shreyansh Paliwal Date: Sun, 08 Feb 2026 04:44:14 GMT Subject: Re: [PATCH V2 2/3] wt-status: pass struct repository and wt_status through function parameters Message-ID: <20260208044450.34444-1-shreyanshpaliwalcmsmn@gmail.com> In-Reply-To: > Shreyansh Paliwal writes: > > > -int wt_status_check_rebase(const struct worktree *wt, > > - struct wt_status_state *state) > > +int wt_status_check_rebase(struct repository *r, > > + const struct worktree *wt, > > + struct wt_status_state *state) > > Funny indentation. my bad, will fix it. > > Besides, should we adding a yet another repository parameter to the > function? The worktree wt knows what repository it belongs to. > > > -int wt_status_check_bisect(const struct worktree *wt, > > +int wt_status_check_bisect(struct repository *r, > > + struct worktree *wt, > > struct wt_status_state *state) > > Same comment about "r" vs "wt->repo" applies here. Actually adding another repository parameter to both of these functions is needed because of the calls like wt_status_check_rebase(NULL, state) and wt_status_check_bisect(NULL, state) from wt_status_get_state(). In the case where wt is NULL, accessing wt->repo can lead to issues.