Skip to main content

create_branch_in_worktree

Function create_branch_in_worktree 

Source
pub fn create_branch_in_worktree(branch: &str, dry_run: bool) -> Result<()>
Expand description

Create branch in a new worktree of its own instead of checking it out here, leaving the current worktree on the branch it was already on.

The directory is derived from the branch name under settings::worktree_dir, nested so feat/a keeps a basename matching the branch tail - the way git’s own path-to-branch guessing would read it.