(repo: string, branch: string)
| 57 | } |
| 58 | |
| 59 | /** The `kild/<name>` branch ref a worktree name maps to. Deterministic, no I/O. */ |
| 60 | export 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. */ |
| 67 | export 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 |
no test coverage detected