MCPcopy Create free account
hub / github.com/Wirasm/kild / createWorktree

Function createWorktree

engine/src/kild/worktree.ts:59–68  ·  view source on GitHub ↗
(repo: string, branch: string)

Source from the content-addressed store, hash-verified

57}
58
59/** The `kild/<name>` branch ref a worktree name maps to. Deterministic, no I/O. */
60export function worktreeRef(name: string): string {
61 assertSafeBranch(name);
62 return `kild/${name}`;
63}
64
65/** The kild worktree name a `kild/<name>` branch ref carries (the inverse of
66 * {@link worktreeRef}). Non-kild refs pass through unchanged. */
67export function worktreeName(branch: string): string {
68 return branch.replace(/^kild\//, '');
69}
70
71/** The on-disk path a worktree name maps to. Deterministic, no I/O — so the engine

Callers 1

kildToolsFunction · 0.90

Calls 3

assertSafeBranchFunction · 0.85
worktreePathFunction · 0.85
worktreeRefFunction · 0.85

Tested by

no test coverage detected