Skip to content

feat(server): walk into nested git repos in the workspace tree - #8

Merged
jlmcmich merged 1 commit into
mainfrom
feat/submodule-expansion
Apr 19, 2026
Merged

feat(server): walk into nested git repos in the workspace tree#8
jlmcmich merged 1 commit into
mainfrom
feat/submodule-expansion

Conversation

@jlmcmich

Copy link
Copy Markdown
Owner

When a workspace root is itself a git repo AND contains nested git repos (submodules, sibling project checkouts, etc.), git ls-files returns 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 .git entry. 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

  • New regression test walks into nested git repos creates a parent repo with a nested untracked repo, confirms inner files are visible
  • Concurrent-build dedup test updated (root readdir count 1 → 2: one probe + one walk)
  • All 15 WorkspaceEntries tests pass

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>
@jlmcmich
jlmcmich merged commit 5bd5ba2 into main Apr 19, 2026
@jlmcmich
jlmcmich deleted the feat/submodule-expansion branch April 19, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant