Skip to main content

Module worktree

Module worktree 

Source

Structs§

ApplySuccess
Returned on a successful apply.
ConflictError
A conflict prevented the merge from completing cleanly.
FileSummary
Per-file summary entry returned by worktree_diff.
WorktreeDiff
The aggregate diff for a single run’s worktree. Returned by GET /api/worktree/:run_id/diff.
WorktreeGuard
A live per-run worktree. Created by create_worktree and cleaned up when dropped (synchronous, so it works inside both regular code and Drop impls). Moving it into the ACP stream generator ensures cleanup on stream completion or on early client disconnect.

Enums§

ApplyMode
The mode for applying a completed run’s changes.
FileChangeKind
Change status for one file in the diff summary.

Functions§

apply_worktree
Apply the worktree’s changes: commit → merge into base OR commit → push → PR.
create_worktree
Create a git worktree for one agent run with an auto-generated branch name (ryu/run-<id>). Thin wrapper over create_worktree_in.
create_worktree_in
Create a git worktree for one agent run.
find_git_root
Find the root of the git repository containing path.
is_git_repo
Detect whether path is inside a git repository. Used to gate worktree isolation — non-repo directories fall back to the plain cwd path.
worktree_diff
Compute the aggregate diff for a live worktree.