Run a git command synchronously in the given dir for test setup.
(cwd: string, args: string[])
| 24 | |
| 25 | /** Run a git command synchronously in the given dir for test setup. */ |
| 26 | function gitSetup(cwd: string, args: string[]): void { |
| 27 | const r = spawnSync('git', args, { cwd, encoding: 'utf-8' }); |
| 28 | if (r.status !== 0) { |
| 29 | throw new Error(`git ${args.join(' ')} failed: ${r.stderr || r.stdout}`); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | describe('Git tools — using a real temp repo', () => { |
| 34 | let repo: string; |