From: Patrick Steinhardt Date: Tue, 12 May 2026 07:13:57 GMT Subject: Re: [PATCH v3 1/2] config: refactor include_by_gitdir() into include_by_path() Message-ID: In-Reply-To: <20260403-includeif-worktree-v3-1-109ce5782b03@black-desk.cn> On Fri, Apr 03, 2026 at 03:02:28PM +0800, Chen Linxuan via B4 Relay wrote: > From: Chen Linxuan > > The include_by_gitdir() function matches the realpath of a given > path against a glob pattern, but its interface is tightly coupled to > the gitdir condition: it takes a struct config_options *opts and > extracts opts->git_dir internally. > > Refactor it into a more generic include_by_path() helper that takes > a const char *path parameter directly, and update the gitdir and > gitdir/i callers to pass opts->git_dir explicitly. No behavior > change, just preparing for the addition of a new worktree condition > that will reuse the same path-matching logic with a different path. Good preparatory step. Patrick