MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / uncoveredNestedRepo

Method uncoveredNestedRepo

src/mcp/tools.ts:2571–2585  ·  view source on GitHub ↗

* The nested git repository `projectPath` lives in when the index the * up-walk reached (`indexRoot`'s, open as `cg`) holds none of its files; null * when that index covers it — an ordinary subdirectory, a submodule or * embedded clone the ancestor indexes, a linked worktree (#155) — or whe

(projectPath: string, indexRoot: string, cg: CodeGraph)

Source from the content-addressed store, hash-verified

2569 * index is honored without a restart.
2570 */
2571 private uncoveredNestedRepo(projectPath: string, indexRoot: string, cg: CodeGraph): NestedRepository | null {
2572 const cacheKey = `${projectPath}\u0000${indexRoot}`;
2573 let nested = this.nestedRepoCache.get(cacheKey);
2574 if (nested === undefined) {
2575 nested = nestedRepositoryBelow(projectPath, indexRoot);
2576 this.nestedRepoCache.set(cacheKey, nested);
2577 }
2578 if (!nested) return null;
2579 try {
2580 return cg.hasFilesUnder(nested.relPath) ? null : nested;
2581 } catch {
2582 // An index we can't read is no evidence the repository is excluded.
2583 return null;
2584 }
2585 }
2586
2587 /**
2588 * Wait for a project to finish rebuilding, off this thread, the secondary

Callers 1

getCodeGraphMethod · 0.95

Calls 4

nestedRepositoryBelowFunction · 0.90
getMethod · 0.65
setMethod · 0.45
hasFilesUnderMethod · 0.45

Tested by

no test coverage detected