mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 06:27:43 +00:00
rewrite: drop redundant update of parent_mapping after rebasing commit
In the normal case when we don't abandon a commit because it became empty, then `CommitBuilder::write()` will have recorded the new commit as a rewrite of the old commit. We don't need to do that again in `rebase_one()`.
This commit is contained in:
parent
4406005dce
commit
e55ebd4fe6
1 changed files with 3 additions and 3 deletions
|
@ -582,15 +582,15 @@ impl<'settings, 'repo> DescendantRebaser<'settings, 'repo> {
|
|||
let new_commit = match rebased_commit {
|
||||
RebasedCommit::Rewritten(new_commit) => new_commit,
|
||||
RebasedCommit::Abandoned { parent } => {
|
||||
self.mut_repo
|
||||
.parent_mapping
|
||||
.insert(old_commit_id.clone(), vec![parent.id().clone()]);
|
||||
self.mut_repo.abandoned.insert(old_commit.id().clone());
|
||||
parent
|
||||
}
|
||||
};
|
||||
self.rebased
|
||||
.insert(old_commit_id.clone(), new_commit.id().clone());
|
||||
self.mut_repo
|
||||
.parent_mapping
|
||||
.insert(old_commit_id.clone(), vec![new_commit.id().clone()]);
|
||||
self.update_references(old_commit_id, vec![new_commit.id().clone()])?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue