MCPcopy Create free account
hub / github.com/Effect-TS/effect / createWorktree

Function createWorktree

packages/effect/typeperf/compare.mjs:235–246  ·  view source on GitHub ↗
(runRoot, name, sha)

Source from the content-addressed store, hash-verified

233}
234
235const createWorktree = (runRoot, name, sha) => {
236 const path = join(runRoot, name)
237 runGit(["worktree", "add", "--detach", path, sha])
238 try {
239 linkDirectory(join(repoRoot, "node_modules"), join(path, "node_modules"))
240 linkDirectory(join(effectDir, "node_modules"), join(path, "packages", "effect", "node_modules"))
241 } catch (error) {
242 removeWorktree(path)
243 throw error
244 }
245 return path
246}
247
248const removeWorktree = (path) => {
249 const result = run("git", ["worktree", "remove", "--force", path], { cwd: repoRoot })

Callers 1

mainFunction · 0.85

Calls 4

runGitFunction · 0.85
linkDirectoryFunction · 0.85
removeWorktreeFunction · 0.85
joinFunction · 0.50

Tested by

no test coverage detected