Repository navigation
Skip linked worktrees of the same repository nested under the project root (#746) - #1010
Queued
aft-alfonso[bot] wants to merge 2 commits into
Queued
aft-alfonso[bot] wants to merge 2 commits into
aft-alfonso[bot] wants to merge 2 commits into
Conversation
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com> (cherry picked from commit 3f3b801d3c12a2eac64b2955e89c3c79511d84a8)
…se note Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
ualtinok
added this pull request to the merge queue
Oct 26, 2026
Any commits made after this event will not be merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #746. A project folder that contains linked git worktrees of its own repository (for example under .worktrees/) was walked again for each worktree, so text search, semantic indexing, inspect and the watcher handled tens of thousands of duplicate files and search returned duplicate hits. Ufuk decided to skip them in every walk.
One shared boundary (project_content::NestedWorktreeBoundary) marks a directory as a nested linked worktree when its .git is a file whose gitdir resolves into this repository's common dir under worktrees/. Every content-reading walk prunes it: the trigram build and refresh, semantic enumeration, grep and glob fallback walks, the callgraph walk, inspect's entry-point and resolver walks, and the file watcher. Nested independent repositories and submodules are still walked. A path the agent names explicitly inside such a worktree is still read, the same rule as an explicitly named gitignored path.
Tests use real git fixtures (git init plus git worktree add into a subfolder) for each walk, an independent nested repo, a submodule-style gitdir, a worktree of another repository, and an explicitly named target.