Skip to content

Commit 04ed024

Browse files
committed
docs(config): state how ignore_worktrees treats subdirectories
The review of 2026-10-01 asked for this to be a stated decision rather than a side effect. Detection walks up from the given path to the nearest .git entry, so a subdirectory of a linked worktree is treated as that worktree: index_repository on it is refused, and a session root or hook working directory inside it is handled the same way. The walk stops at the first .git; outside any checkout it runs to the filesystem root one directory at a time. None of it runs while the key is off. Signed-off-by: Martin Vogel <[email protected]>
1 parent 77310d5 commit 04ed024

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎docs/CONFIGURATION.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ The main checkout of the same repository is unaffected, as are ordinary clones
154154
and submodules. Detection is git plumbing only: a linked worktree's `.git` is a
155155
file pointing at a gitdir that contains a `commondir` entry.
156156
157+
A subdirectory counts as the worktree it sits in. Detection walks up from the
158+
given path to the nearest `.git` entry, so `index_repository` on any
159+
subdirectory of a linked worktree is refused the same way, and a session root or
160+
hook working directory inside one is treated as that worktree. The walk stops at
161+
the first `.git` it finds; a main checkout or a submodule ends it as "not a
162+
worktree". A path outside any git checkout is checked one directory at a time up
163+
to the filesystem root and is never treated as a worktree. None of this runs
164+
while the key is off.
165+
157166
The default is `false`, so indexing behavior is unchanged unless you opt in.
158167
159168
## 3. UI Settings

0 commit comments

Comments
 (0)