Skip to main content

rebase_start

Function rebase_start 

Source
pub async fn rebase_start(
    repo: &Path,
    scratch: &Path,
    branch: &str,
    onto: &str,
) -> Result<RebaseStart>
Expand description

Start rebasing branch onto onto inside a throwaway worktree, and leave a conflict standing.

A worktree of its own for two reasons. The repository magi runs in may be jj-colocated, where git HEAD is detached and a rebase in the primary tree would move it under the operator; and a rebase that hits a conflict leaves state behind, which is far easier to discard with the whole directory than to unpick in a tree somebody is using.

Unlike rebase_branch_in_temp this does not abort on a conflict: the caller decides whether to hand the conflicted tree to a fixer or to call rebase_abort. Any leftover at scratch from an earlier attempt is removed first, so callers re-entering a rebase already in progress must check rebase_in_progress before calling this.