| 8810 | } |
| 8811 | |
| 8812 | function initGitRepo(): void { |
| 8813 | const { execFileSync } = require('child_process') as typeof import('child_process'); |
| 8814 | execFileSync('git', ['init'], { cwd: tempDir, stdio: 'ignore' }); |
| 8815 | execFileSync('git', ['add', '-A'], { cwd: tempDir, stdio: 'ignore' }); |
| 8816 | execFileSync( |
| 8817 | 'git', |
| 8818 | ['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'init'], |
| 8819 | { cwd: tempDir, stdio: 'ignore' }, |
| 8820 | ); |
| 8821 | } |
| 8822 | |
| 8823 | it('excludes node_modules ignored only by a nested .gitignore (git path)', () => { |
| 8824 | fs.mkdirSync(path.join(tempDir, 'frontend', 'src'), { recursive: true }); |