A repo at `dir` with `tracked` committed, then `untracked` written for `.gitignore` to hide.
(dir: string, tracked: Record<string, string>, untracked: Record<string, string> = {})
| 41 | |
| 42 | /** A repo at `dir` with `tracked` committed, then `untracked` written for `.gitignore` to hide. */ |
| 43 | function makeRepo(dir: string, tracked: Record<string, string>, untracked: Record<string, string> = {}): void { |
| 44 | for (const [rel, content] of Object.entries(tracked)) write(path.join(dir, rel), content); |
| 45 | git(dir, 'init', '-q'); |
| 46 | git(dir, 'add', '-A'); |
| 47 | git(dir, '-c', 'user.email=t@t', '-c', 'user.name=t', 'commit', '-qm', 'init'); |
| 48 | for (const [rel, content] of Object.entries(untracked)) write(path.join(dir, rel), content); |
| 49 | } |
| 50 | |
| 51 | /** What git reports as ignored-untracked, relative to `cwd`. */ |
| 52 | function gitIgnored(cwd: string): string[] { |
no test coverage detected