MCPcopy Index your code
hub / github.com/changesets/changesets / createShallowClone

Function createShallowClone

packages/git/src/index.test.ts:287–303  ·  view source on GitHub ↗
(
        depth: number,
        cwd: string
      )

Source from the content-addressed store, hash-verified

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({

Callers 1

index.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…