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

Function findUnindexedIgnoredRepos

src/extraction/index.ts:830–852  ·  view source on GitHub ↗
(rootDir: string)

Source from the content-addressed store, hash-verified

828 * on a giant ignored tree.
829 */
830export function findUnindexedIgnoredRepos(rootDir: string): string[] {
831 try {
832 execFileSync('git', ['rev-parse', '--git-dir'], { cwd: rootDir, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });
833 } catch {
834 return [];
835 }
836 const defaults = defaultsOnlyIgnore();
837 const includeIgnored = loadIncludeIgnoredMatcher(rootDir);
838 const repos: string[] = [];
839 for (const dir of listIgnoredDirs(rootDir)) {
840 if (defaults.ignores(dir)) continue; // node_modules etc. — never project code
841 if (includeIgnored?.ignores(normalizePath(dir))) continue; // already opted in — nothing to nag about
842 for (const repo of findNestedGitRepos(path.join(rootDir, dir), dir)) {
843 // Per-repo opt-in check, mirroring findIgnoredEmbeddedRepos: a child
844 // pattern (`repos/a/`) doesn't match the parent dir above but DOES
845 // cover this repo — it's indexed, so don't nag about it (#1295).
846 if (includeIgnored?.ignores(normalizePath(repo))) continue;
847 repos.push(repo);
848 if (repos.length >= UNINDEXED_IGNORED_REPO_HINT_CAP) return repos;
849 }
850 }
851 return repos;
852}
853
854/**
855 * Discover embedded repos hidden by `repoDir`'s OWN gitignore rules: for each

Callers 2

offerIndexIgnoredReposFunction · 0.85

Calls 7

normalizePathFunction · 0.90
defaultsOnlyIgnoreFunction · 0.85
listIgnoredDirsFunction · 0.85
findNestedGitReposFunction · 0.85
ignoresMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected