summaryrefslogtreecommitdiff
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorChen Linxuan <me@black-desk.cn>2026-07-10 14:43:30 +0800
committerJunio C Hamano <gitster@pobox.com>2026-07-10 08:19:15 -0700
commit5004829756596498a20305b3fce8387629396835 (patch)
treeeeb0918a190fbee15480559bd8f00447820d918c /contrib/persistent-https
parent52bd2ff2741e376ab8b92c354ba64bdf9d1c2c0a (diff)
config: add "worktree" and "worktree/i" includeIf conditions
The includeIf mechanism already supports matching on the .git directory path (gitdir) and the currently checked out branch (onbranch). But in multi-worktree setups the .git directory of a linked worktree points into the main repository's .git/worktrees/ area, which makes gitdir patterns cumbersome when one wants to include config based on the working tree's checkout path instead. Introduce two new condition keywords: - worktree:<pattern> matches the realpath of the current worktree's working directory (i.e. repo_get_work_tree()) against a glob pattern. This is the path returned by git rev-parse --show-toplevel. - worktree/i:<pattern> is the case-insensitive variant. The implementation reuses the include_by_path() helper introduced in the previous commit, passing the worktree path in place of the gitdir. The condition never matches in bare repositories (where there is no worktree) or during early config reading (where no repository is available). Add documentation describing the new conditions, including a comparison with extensions.worktreeConfig and a note that worktree matching currently uses the realpath-resolved worktree location. Add tests covering bare repositories, multiple worktrees, realpath-resolved symlinked worktree paths, case-sensitive and case-insensitive matching, early config reading, and non-repository scenarios. Signed-off-by: Chen Linxuan <me@black-desk.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions