WorktreeInput
Type, in @jr2/orchestrator/src/worktree.ts. It is an export of @jr2/orchestrator, in the Effects group of the Authoring surface page.
type WorktreeInput =
| {
path: AnyWorktreePath;
branch: string;
from?: string;
detach?: never;
handoff?: never;
expect?: never;
}
| {
path: AnyWorktreePath;
detach: string;
branch?: never;
from?: never;
handoff?: never;
expect?: never;
}
| {
path: AnyWorktreePath;
handoff: Handoff;
branch?: string;
detach?: never;
from?: never;
expect?: never;
};The input of a worktree(): a branch Worktree, a detached one, or a branch Worktree at a Handoff.
Forms: it is one of these objects.
Form 1:
path,branch,from,detach,handoff,expectpath:AnyWorktreePathThe root of the Worktree:
${context.workspace.repos.app}/<name>, a constant word.branch:stringThe branch. It resolves as a local branch, then
origin/<branch>(tracked), then a new branch.from(optional):stringWhere a new branch starts. Default: the Binding's base. On a branch that exists, it must be that branch's tip, or the cut is
refused.detach(optional):neverhandoff(optional):neverexpect(optional):never
Form 2:
path,detach,branch,from,handoff,expectpath:AnyWorktreePathdetach:stringThe commit to check out, with no branch. The Worktree is forced to it and cleaned on each cut. Ignored files stay, so that a reviewer can run the tests.
branch(optional):neverfrom(optional):neverhandoff(optional):neverexpect(optional):never
Form 3:
path,handoff,branch,detach,from,expectpath:AnyWorktreePathhandoff:HandoffThe commit of a
readycut of an enclosing Workspace of this run, which this nested Workspace takes (ADR-0080). The cut checks each field against the run's ledger.branch(optional):stringThe branch of the new Worktree. Default: the Handoff's branch. A detached Handoff needs it.
detach(optional):neverfrom(optional):neverexpect(optional):never