| 1 | import { tmpdir } from 'node:os'; |
| 2 | import { describe, expect |
| 3 | |
| 4 | import { runGit, runGitStream |
| 5 | |
| 6 | // More than a pipe buffer holds, handed to a git command that exits without reading stdin, so the write fails with EPIPE. |
| 7 | const unread = { |
| 8 | args: ['version'], |
| 9 | gitDir: tmpdir(), |
| 10 | input: Buffer.alloc |
| 11 | }; |
| 12 | |
| 13 | describe('git exiting before it reads its input', () |
| 14 | it('leaves runGit with the exit status, not an unhandled EPIPE', |
| 15 | expect(await runGit |
| 16 | }); |
| 17 | |
| 18 | it('leaves runGitStream with the exit status, not an unhandled EPIPE', |
| 19 | let output = |
| 20 | for await (const |
| 21 | expect(output).toContain |
| 22 | }); |
| 23 | }); |