(
depth: number,
cwd: string
)
| 285 | } |
| 286 | |
| 287 | async function createShallowClone( |
| 288 | depth: number, |
| 289 | cwd: string |
| 290 | ): Promise<string> { |
| 291 | // Make a 1-commit-deep shallow clone of this repo |
| 292 | const cloneDir = tempdir(); |
| 293 | await spawn( |
| 294 | "git", |
| 295 | // Note: a file:// URL is needed in order to make a shallow clone of |
| 296 | // a local repo |
| 297 | ["clone", "--depth", depth.toString(), fileUrl(cwd), "."], |
| 298 | { |
| 299 | cwd: cloneDir, |
| 300 | } |
| 301 | ); |
| 302 | return cloneDir; |
| 303 | } |
| 304 | |
| 305 | it("reads the SHA of a file-add without deepening if commit already included in the shallow clone", async () => { |
| 306 | const cwd = await gitdir({ |
no outgoing calls
no test coverage detected
searching dependent graphs…