Skip to content

Commit

Permalink
rewrite: inline specialized rebase_commit_with_options() in rebase()
Browse files Browse the repository at this point in the history
`rebase_commit_with_options()` now does very little, and we don't want
most of it in `rebase()`.
  • Loading branch information
martinvonz committed Apr 18, 2024
1 parent 2859277 commit a5e6b1f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,8 @@ pub fn rebase_commit(
new_parents: Vec<CommitId>,
) -> BackendResult<Commit> {
let rewriter = CommitRewriter::new(mut_repo, old_commit, new_parents);
let rebased_commit = rebase_commit_with_options(settings, rewriter, &Default::default())?;
match rebased_commit {
RebasedCommit::Rewritten(new_commit) => Ok(new_commit),
RebasedCommit::Abandoned { parent: _ } => panic!("Commit was unexpectedly abandoned"),
}
let builder = rewriter.rebase(settings)?;
builder.write()
}

/// Helps rewrite a commit.
Expand Down

0 comments on commit a5e6b1f

Please sign in to comment.