diff --git a/lib/src/rewrite.rs b/lib/src/rewrite.rs index 7cd6fd560..f7eec17cf 100644 --- a/lib/src/rewrite.rs +++ b/lib/src/rewrite.rs @@ -475,7 +475,7 @@ pub fn compute_move_commits( ) -> BackendResult { let target_commit_ids: IndexSet; let connected_target_commits: Vec; - let connected_target_commits_internal_parents: HashMap>; + let connected_target_commits_internal_parents: HashMap>; let target_roots: HashSet; match &loc.target { @@ -1030,15 +1030,15 @@ pub fn duplicate_commits_onto_parents( fn compute_internal_parents_within( target_commit_ids: &IndexSet, graph_commits: &[Commit], -) -> HashMap> { - let mut internal_parents: HashMap> = HashMap::new(); +) -> HashMap> { + let mut internal_parents: HashMap> = HashMap::new(); for commit in graph_commits.iter().rev() { // The roots of the set will not have any parents found in `internal_parents`, // and will be stored as an empty vector. - let mut new_parents = vec![]; + let mut new_parents = IndexSet::new(); for old_parent in commit.parent_ids() { if target_commit_ids.contains(old_parent) { - new_parents.push(old_parent.clone()); + new_parents.insert(old_parent.clone()); } else if let Some(parents) = internal_parents.get(old_parent) { new_parents.extend(parents.iter().cloned()); }