* 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)
| 512 | * `git status` quiet; that does not make them third-party code). (#514) |
| 513 | */ |
| 514 | function 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. */ |
| 528 | const EMBEDDED_REPO_SEARCH_DEPTH = 4; |
no test coverage detected