From: Patrick Steinhardt Date: Tue, 19 May 2026 09:50:55 GMT Subject: Re: [PATCH 02/18] setup: stop using `the_repository` in `is_inside_worktree()` Message-ID: In-Reply-To: On Tue, May 19, 2026 at 10:22:20AM +0900, Junio C Hamano wrote: > Patrick Steinhardt writes: > > >> I do not offhand know if other code paths that are called from this > >> function are thread-safe, but yeah, this use of file-scope static is > >> not a safe thing to do. > > > > In the current status quo this is a safe conversion to do, as we still > > have the assumption ingrained that this only works for a single repo. > > We were using static variables before, and we're still using static > > variables now. > > > > That being said, I wouldn't mind dropping the static variable if this is > > something we'd rather want to get rid of. It's a smell that I'm not > > particularly happy about myself. > > > > I'll send a revised version in a bit, thanks! > > OK. In the v2 (perhaps v3?) series, I can see the removal of two > static strbuf based "optimizations" is the only change since the > previous round (after merging the previous one to the base of the > new iteration and comparing the result with the new iteration). > > Looking very good. Shall we mark the topic for 'next' now? I'll send one final round to address Karthik's comment on the commit message, but once that's out I think this series is ready. Thanks! Patrick