Re: [PATCH V2 2/3] wt-status: pass struct repository and wt_status through function parameters
- From
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
- Date
- Feb 8, 2026, 04:44 UTC
- Message-ID
- <20260208044450.34444-1-shreyanshpaliwalcmsmn@gmail.com>
- In-Reply-To
- <xmqqtsvs9gij.fsf@gitster.g>
Show 9 quoted lines
> Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> 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.
Show 10 quoted lines
> > 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.