mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-25 05:29:39 +00:00
rewrite: rebase_commits_with_options
: avoid cloning of new parents
This commit is contained in:
parent
793e9f100f
commit
cb1e0fbafc
1 changed files with 2 additions and 2 deletions
|
@ -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(),
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue