MCPcopy
hub / github.com/colbymchenry/codegraph / findIgnoredEmbeddedRepos

Function findIgnoredEmbeddedRepos

src/extraction/index.ts:630–640  ·  view source on GitHub ↗

* Discover embedded repos hidden by `repoDir`'s OWN gitignore rules: for each * gitignored directory, search for nested `.git` roots. Returns repo paths * relative to `repoDir`, trailing-slashed. * * OPT-IN ONLY. Walking into a gitignored directory contradicts what every other * tool (and CodeG

(repoDir: string, includeIgnored: Ignore | null, prefix: string)

Source from the content-addressed store, hash-verified

628 * default excludes (`node_modules`, …) are always skipped.
629 */
630function findIgnoredEmbeddedRepos(repoDir: string, includeIgnored: Ignore | null, prefix: string): string[] {
631 if (!includeIgnored) return [];
632 const defaults = defaultsOnlyIgnore();
633 const repos: string[] = [];
634 for (const dir of listIgnoredDirs(repoDir)) {
635 if (defaults.ignores(dir)) continue;
636 if (!includeIgnored.ignores(normalizePath(prefix + dir))) continue;
637 repos.push(...findNestedGitRepos(path.join(repoDir, dir), dir));
638 }
639 return repos;
640}
641
642/**
643 * Collect git-visible files (tracked + untracked, .gitignore-respected) from the

Callers 3

visitFunction · 0.85
collectGitFilesFunction · 0.85
collectGitStatusFunction · 0.85

Calls 6

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

Tested by

no test coverage detected