Skip to main content

Module worktree

Module worktree 

Source
Expand description

Git worktree management for task execution.

Each task runs in an isolated worktree to prevent conflicts. Worktrees are stored at ~/.orch/worktrees/<project>/<branch>/.

Structs§

WorktreeSetup
Result of worktree setup.

Functions§

abort_worktree_rebase
Abort any rebase in progress for a worktree.
branch_name
Generate a branch name from task ID and title.
detect_default_branch
Detect the default branch of a repository.
list_project_worktrees
List all worktree directories for a project.
project_name
Canonical project name used under ~/.orch/worktrees/.
project_worktrees_dir
Base worktrees directory for a project.
rebase_worktree_on_origin_main
Rebase a worktree on top of origin/{default_branch}.
resolve_main_repo
Resolve PROJECT_DIR to the main repo if it’s inside a worktree.
setup_worktree
Set up a worktree for task execution.
task_id_from_worktree_name
Extract a task ID from a worktree directory name.
validate_worktree_gitdir
Validate that a worktree directory has a working gitdir link.