| 18 | type CheckoutArgs = Parameters<IsomorphicGitClient["checkout"]>[0]; |
| 19 | |
| 20 | function fakeGit() { |
| 21 | const cloneCalls: CloneArgs[] = []; |
| 22 | const checkoutCalls: CheckoutArgs[] = []; |
| 23 | const git: IsomorphicGitClient = { |
| 24 | clone: vi.fn(async (args: CloneArgs) => { |
| 25 | cloneCalls.push(args); |
| 26 | }), |
| 27 | checkout: vi.fn(async (args: CheckoutArgs) => { |
| 28 | checkoutCalls.push(args); |
| 29 | }), |
| 30 | }; |
| 31 | return { git, cloneCalls, checkoutCalls }; |
| 32 | } |
| 33 | |
| 34 | // FsClient and HttpClient are opaque collaborators for cloneWith; |
| 35 | // it never inspects them, only forwards. |