MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / create_worktree

Function create_worktree

src/utils/git.py:347–363  ·  view source on GitHub ↗
(
    path: str,
    branch: str | None = None,
    cwd: str | None = None,
    *,
    new_branch: bool = False,
)

Source from the content-addressed store, hash-verified

345
346
347def create_worktree(
348 path: str,
349 branch: str | None = None,
350 cwd: str | None = None,
351 *,
352 new_branch: bool = False,
353) -> bool:
354 args = ["worktree", "add"]
355 if new_branch and branch:
356 args.extend(["-b", branch, path])
357 elif branch:
358 args.extend([path, branch])
359 else:
360 args.append(path)
361
362 _, _, rc = _run_git(args, cwd)
363 return rc == 0
364
365
366def remove_worktree(

Callers

nothing calls this directly

Calls 2

_run_gitFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected