A git worktree nested in a project (e.g. Claude Code's gitignored `.claude/worktrees/<name>/`) was swept into the index as an embedded repo: its `.git` is a FILE pointing into the host repo's `.git/worktrees/`, and embedded- repo discovery treated any `.git` (file or directory) as a distinct repo to index. Each worktree then duplicated the entire graph — one report went from ~1,850 files to 24,533, with search/explore flooded by stale copies. classifyGitDir() now distinguishes: - `.git` directory -> embedded clone, index (#193/#514/#622, unchanged) - `.git` file → worktrees/ -> worktree, skip (#848) - `.git` file → modules/ -> submodule, index (unchanged) Applied at both embedded-repo entry points: findNestedGitRepos discovery (which also covers the sync/change-detection path) and the untracked-subdir recursion in collectGitFiles. Verified: the reproduction drops from 6 files / betaHelper×3 to 3 files / ×1, with a genuine embedded clone and submodules still indexed. Regression test added. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
64ff7597d0
commit
5cc155ddc4
@@ -17,6 +17,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
### Fixes
|
||||
|
||||
- Git worktrees nested inside your project — like the `.claude/worktrees/` that Claude Code creates — are no longer indexed as duplicate copies of your whole codebase. CodeGraph deliberately indexes genuine embedded repos (a real second project checked out inside yours), but a worktree is just another working view of a repo it already indexed, so each one was multiplying every symbol — one report went from ~1,850 files to over 24,000, with search and `explore` flooded by stale duplicates. CodeGraph now recognizes worktrees and skips them, while still indexing real embedded repos and submodules. Thanks @tphakala. (#848)
|
||||
- Running `codegraph serve --mcp` by hand no longer just hangs in silence. That command is the MCP server your AI agent starts for itself — not a step you run directly — and in a terminal it used to sit there waiting for input that never comes, looking broken. It now recognizes when a person runs it and explains what to do instead (`codegraph status`, `codegraph daemon`), and it's been dropped from the command listing so it stops looking like something you need to launch.
|
||||
- Cross-file static method calls like `ClassName.staticMethod()` now resolve correctly. CodeGraph was linking the call to the *class* instead of the method (and recording it as a construction), so `callers` and `impact` for a static method came back empty — a real blind spot in TypeScript and JavaScript codebases that lean on static utility classes (Python and other languages with the same call shape benefit too). The call now links to the method itself. Thanks @contextFlow-lab. (#825)
|
||||
- `codegraph affected` now accepts `./`-prefixed and absolute file paths, not just bare project-relative ones. Passing `./src/x.ts` or an absolute path — common when the file list comes from another tool — used to silently match nothing and report no affected tests. Thanks @contextFlow-lab. (#825)
|
||||
|
||||
Reference in New Issue
Block a user