Skip to content

Commit

Permalink
rewrite: rebase_commits_with_options: avoid cloning of new parents
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnt4n committed Nov 12, 2024
1 parent 793e9f1 commit cb1e0fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,12 @@ pub fn rebase_commit_with_options(
[parent_id] => Some(parent_id.clone()),
_ => None,
};
let new_parents = rewriter.new_parents.clone();
let new_parents_len = rewriter.new_parents.len();
if let Some(builder) = rewriter.rebase_with_empty_behavior(settings, options.empty)? {
let new_commit = builder.write()?;
Ok(RebasedCommit::Rewritten(new_commit))
} else {
assert_eq!(new_parents.len(), 1);
assert_eq!(new_parents_len, 1);
Ok(RebasedCommit::Abandoned {
parent_id: single_parent.unwrap(),
})
Expand Down

0 comments on commit cb1e0fb

Please sign in to comment.