mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-24 12:48:55 +00:00
merged_tree: in diff iterator, maintain legacy/modern variant in subtree
As #2165 showed, when diffing two `MergedTree::Legacy` variants (or one of each variant) and re recurse into a subtree, we need to treat that as a legacy tree too, so we expand `TreeValue::Conflict`s found in the diff.
This commit is contained in:
parent
f3fbdf9f84
commit
598cfcb89b
2 changed files with 6 additions and 6 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue