(remoteUrl: string)
| 140 | } |
| 141 | |
| 142 | function setupGstackRepo(remoteUrl: string) { |
| 143 | // Real git repo at gstackHome with at least one commit + an origin remote. |
| 144 | fs.mkdirSync(gstackHome, { recursive: true }); |
| 145 | spawnSync('git', ['-C', gstackHome, 'init', '-q', '-b', 'main'], { stdio: 'pipe' }); |
| 146 | spawnSync('git', ['-C', gstackHome, 'config', 'user.email', 'test@example.com'], { stdio: 'pipe' }); |
| 147 | spawnSync('git', ['-C', gstackHome, 'config', 'user.name', 'test'], { stdio: 'pipe' }); |
| 148 | fs.writeFileSync(path.join(gstackHome, '.brain-allowlist'), '# allowlist\n'); |
| 149 | spawnSync('git', ['-C', gstackHome, 'add', '.'], { stdio: 'pipe' }); |
| 150 | spawnSync('git', ['-C', gstackHome, 'commit', '-q', '-m', 'init'], { stdio: 'pipe' }); |
| 151 | spawnSync('git', ['-C', gstackHome, 'remote', 'add', 'origin', remoteUrl], { stdio: 'pipe' }); |
| 152 | } |
| 153 | |
| 154 | beforeEach(() => { |
| 155 | tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-wireup-test-')); |
no test coverage detected