rewrite: remove redundant commit_id.clone() from merge_commit_trees*()

This commit is contained in:
Yuya Nishihara 2024-08-10 21:42:43 +09:00
parent ed1c07e73e
commit dac04960f0

View file

@ -53,7 +53,7 @@ pub fn merge_commit_trees_without_repo(
.map(|commit| commit.id().clone())
.collect_vec();
for (i, other_commit) in commits.iter().enumerate().skip(1) {
let ancestor_ids = index.common_ancestors(&commit_ids[0..i], &[commit_ids[i].clone()]);
let ancestor_ids = index.common_ancestors(&commit_ids[0..i], &commit_ids[i..][..1]);
let ancestors: Vec<_> = ancestor_ids
.iter()
.map(|id| store.get_commit(id))