rebase: avoid an unnecessary lookup of parent commits

This commit is contained in:
Martin von Zweigbergk 2024-05-13 06:41:54 -07:00 committed by Martin von Zweigbergk
parent 256988de65
commit 677081ef71

View file

@ -394,7 +394,7 @@ fn rebase_descendants_transaction(
workspace_command.check_rewritable(old_commits.iter().ids())?;
let (skipped_commits, old_commits) = old_commits
.iter()
.partition::<Vec<_>, _>(|commit| commit.parents() == new_parents);
.partition::<Vec<_>, _>(|commit| commit.parent_ids().iter().eq(new_parents.iter().ids()));
let num_skipped_rebases = skipped_commits.len();
if num_skipped_rebases > 0 {
writeln!(