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

Function setupRepoAndClone

packages/release-utils/src/run.test.ts:29–49  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

27});
28
29async function setupRepoAndClone(cwd: string) {
30 await spawn("git", ["init"], { cwd });
31 await add(".", cwd);
32 await commit("commit1", cwd);
33
34 const mainBranch = await getCurrentBranch(cwd);
35
36 // Make a 1-commit-deep shallow clone of this repo
37 let clone = tempdir();
38 await spawn(
39 "git",
40 // Note: a file:// URL is needed in order to make a shallow clone of
41 // a local repo
42 ["clone", "--depth", "1", fileUrl(cwd), "."],
43 {
44 cwd: clone,
45 }
46 );
47 await spawn("git", ["checkout", "-b", "some-other-branch"], { cwd });
48 return { clone, mainBranch };
49}
50
51describe("version", () => {
52 it("returns the right changed packages and pushes to the remote", async () => {

Callers 1

run.test.tsFile · 0.85

Calls 3

addFunction · 0.90
commitFunction · 0.90
getCurrentBranchFunction · 0.90

Tested by

no test coverage detected