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

Function listIgnoredDirs

src/extraction/index.ts:514–525  ·  view source on GitHub ↗

* List the gitignored DIRECTORIES of a repo (collapsed, trailing-slash form), * relative to `repoDir`. These are invisible to every other `git ls-files` / * `git status` mode — and in a multi-repo workspace they are exactly where the * nested project repos live (a super-repo `.gitignore`s its chi

(repoDir: string)

Source from the content-addressed store, hash-verified

512 * `git status` quiet; that does not make them third-party code). (#514)
513 */
514function listIgnoredDirs(repoDir: string): string[] {
515 try {
516 const out = execFileSync(
517 'git',
518 ['ls-files', '-z', '-o', '-i', '--exclude-standard', '--directory'],
519 { cwd: repoDir, encoding: 'utf-8' as const, timeout: 30000, maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'] as ['pipe', 'pipe', 'pipe'], windowsHide: true }
520 );
521 return out.split('\0').filter((e) => e.endsWith('/') && !isWholeCwdEntry(e));
522 } catch {
523 return [];
524 }
525}
526
527/** Max directory depth searched below an ignored dir for nested `.git` roots. */
528const EMBEDDED_REPO_SEARCH_DEPTH = 4;

Callers 2

findIgnoredEmbeddedReposFunction · 0.85

Calls 1

isWholeCwdEntryFunction · 0.85

Tested by

no test coverage detected