pub fn init_worktree(
source_root: &Path,
dest_root: &Path,
config: &WorktreesConfig,
) -> CoreResult<()>Expand description
Initialize a new change worktree: copy include files, then run setup commands.
This is the full initialization sequence called after a worktree is created:
- Copy include files from
source_rootintodest_root(idempotent). - Run setup commands from
config.init.setupindest_root(if configured).
Coordination symlink wiring is handled separately by the caller because it
requires the .ito/ path context which this function does not own. Today
that means ito worktree ensure wires new and partially initialized
worktrees, while ito init --update can repair the current worktree.
ยงErrors
Returns CoreError if file copy fails or a setup command exits non-zero.