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

Function create_branch

src/utils/git.py:251–269  ·  view source on GitHub ↗
(
    branch_name: str,
    cwd: str | None = None,
    *,
    checkout: bool = True,
    start_point: str | None = None,
)

Source from the content-addressed store, hash-verified

249
250
251def create_branch(
252 branch_name: str,
253 cwd: str | None = None,
254 *,
255 checkout: bool = True,
256 start_point: str | None = None,
257) -> bool:
258 args = ["checkout", "-b", branch_name]
259 if start_point:
260 args.append(start_point)
261
262 if checkout:
263 _, _, rc = _run_git(args, cwd)
264 else:
265 create_args = ["branch", branch_name]
266 if start_point:
267 create_args.append(start_point)
268 _, _, rc = _run_git(create_args, cwd)
269 return rc == 0
270
271
272def get_commit_attribution(

Callers 1

Calls 2

_run_gitFunction · 0.70
appendMethod · 0.45

Tested by 1