From dac04960f06a7bf947cf674f04aec1f7b05a31db Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 10 Aug 2024 21:42:43 +0900 Subject: [PATCH] rewrite: remove redundant commit_id.clone() from merge_commit_trees*() --- lib/src/rewrite.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/rewrite.rs b/lib/src/rewrite.rs index a924336f1..5e6f913a6 100644 --- a/lib/src/rewrite.rs +++ b/lib/src/rewrite.rs @@ -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))