diff --git a/lib/src/merged_tree.rs b/lib/src/merged_tree.rs index 822663184..ceb61ce9a 100644 --- a/lib/src/merged_tree.rs +++ b/lib/src/merged_tree.rs @@ -739,10 +739,12 @@ impl<'matcher> TreeDiffIterator<'matcher> { } else { Merge::resolved(Tree::null(tree.store().clone(), dir.clone())) }; - // We return a `MergedTree::Merge` variant here even if `self` is a - // `MergedTree::Legacy`. That's fine since we don't expose the - // `MergedTree` to the caller. - MergedTree::Merge(trees) + // Maintain the type of tree, so we resolve `TreeValue::Conflict` as necessary + // in the subtree + match tree { + MergedTree::Legacy(_) => MergedTree::Legacy(trees.into_resolved().unwrap()), + MergedTree::Merge(_) => MergedTree::Merge(trees), + } } } diff --git a/lib/tests/test_working_copy.rs b/lib/tests/test_working_copy.rs index 3d24568d1..f3c55a61a 100644 --- a/lib/tests/test_working_copy.rs +++ b/lib/tests/test_working_copy.rs @@ -271,8 +271,6 @@ fn test_checkout_file_transitions(use_git: bool) { // Test case for issue #2165 #[test] -// TODO(#2165): Shouldn't actually panic -#[should_panic] fn test_conflict_subdirectory() { let settings = testutils::user_settings(); let mut test_workspace = TestWorkspace::init(&settings, true);