feat(server): walk into nested git repos in the workspace tree - #8
Merged
Conversation
When a workspace root is itself a git repo AND contains nested git repos at depth 1 (submodules, sibling project checkouts, etc.), the git-ls-files path returns those nested dirs as opaque entries (`workbench/`, `workbench-pi-fix/`, etc.) and the file tree can't expose what's inside them. Users see an unbrowsable folder. Add a fast detectNestedGitRepos probe that scans only the immediate subdirectories for a `.git` entry (skipping the standard ignored directory names). When it finds any, route the index build through the filesystem walker instead — which already respects gitignore + IGNORED_DIRECTORY_NAMES and walks every directory. Depth is capped at 1 because the routing decision doesn't need to traverse deeper: the filesystem walker handles the rest. Cost is one readdir of the workspace root per cache miss. Updated the concurrent-build test (rootReadCount goes from 1 → 2: one readdir for the probe + one for the walk's root scan; the build dedup behavior is unchanged). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
When a workspace root is itself a git repo AND contains nested git repos (submodules, sibling project checkouts, etc.),
git ls-filesreturns those nested dirs as opaque entries and the file tree can't expose what's inside them.This adds a fast probe that scans only the immediate subdirs of the workspace root for a
.gitentry. When found, routing falls through to the filesystem walker which already respects gitignore + the standard ignored-dir list and walks into every directory.Depth is capped at 1 — only the routing decision needs the probe; the walker takes over from there.
Test plan
walks into nested git reposcreates a parent repo with a nested untracked repo, confirms inner files are visible