mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-24 20:54:15 +00:00
working_copy: show bug when checking out conflict in subdir
This commit is contained in:
parent
79291a3ca4
commit
769c248c49
1 changed files with 23 additions and 0 deletions
|
@ -33,6 +33,7 @@ use jj_lib::op_store::{OperationId, WorkspaceId};
|
||||||
use jj_lib::repo::{ReadonlyRepo, Repo};
|
use jj_lib::repo::{ReadonlyRepo, Repo};
|
||||||
use jj_lib::repo_path::{RepoPath, RepoPathComponent, RepoPathJoin};
|
use jj_lib::repo_path::{RepoPath, RepoPathComponent, RepoPathJoin};
|
||||||
use jj_lib::settings::UserSettings;
|
use jj_lib::settings::UserSettings;
|
||||||
|
use jj_lib::tree::merge_trees;
|
||||||
use jj_lib::tree_builder::TreeBuilder;
|
use jj_lib::tree_builder::TreeBuilder;
|
||||||
use jj_lib::working_copy::{LockedWorkingCopy, SnapshotError, SnapshotOptions, WorkingCopy};
|
use jj_lib::working_copy::{LockedWorkingCopy, SnapshotError, SnapshotOptions, WorkingCopy};
|
||||||
use test_case::test_case;
|
use test_case::test_case;
|
||||||
|
@ -268,6 +269,28 @@ 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);
|
||||||
|
let repo = &test_workspace.repo;
|
||||||
|
|
||||||
|
let path = RepoPath::from_internal_string("sub/file");
|
||||||
|
let empty_tree = create_tree(repo, &[]);
|
||||||
|
let tree1 = create_tree(repo, &[(&path, "0")]);
|
||||||
|
let tree2 = create_tree(repo, &[(&path, "1")]);
|
||||||
|
let merged_tree = merge_trees(&tree1, &empty_tree, &tree2).unwrap();
|
||||||
|
let repo = &test_workspace.repo;
|
||||||
|
let wc = test_workspace.workspace.working_copy_mut();
|
||||||
|
wc.check_out(repo.op_id().clone(), None, &MergedTree::legacy(tree1))
|
||||||
|
.unwrap();
|
||||||
|
wc.check_out(repo.op_id().clone(), None, &MergedTree::legacy(merged_tree))
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[test_case(false ; "local backend")]
|
#[test_case(false ; "local backend")]
|
||||||
#[test_case(true ; "git backend")]
|
#[test_case(true ; "git backend")]
|
||||||
fn test_tree_builder_file_directory_transition(use_git: bool) {
|
fn test_tree_builder_file_directory_transition(use_git: bool) {
|
||||||
|
|
Loading…
Reference in a new issue