From: Karthik Nayak Date: Thu, 05 Feb 2026 11:09:35 GMT Subject: Re: [PATCH V2 2/3] wt-status: pass struct repository and wt_status through function parameters Message-ID: In-Reply-To: <20260205101524.125452-3-shreyanshpaliwalcmsmn@gmail.com> Shreyansh Paliwal writes: > Some functions in wt-status.c relied on the_repository because no > repository instance was available in their local scope. > There is also a specific case in wt_status_check_rebase() where the > worktree can be NULL, so accessing wt->repo may lead to a segfault. > > Update these functions to accept a struct repository or struct > wt_status parameter, and adjust callers accordingly. Replace the > remaining uses of the_repository in these functions with the > passed-in repository instance. > > This removes the use of the_repository global variable from > wt-status.c completely. > Okay, but this doesn't fix the issue I stated in the previous commit. I do wonder if we can re-order the commits and pass the repo struct to functions like 'get_branch()'. [snip]