mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-09 05:58:55 +00:00
working_copy: avoid a nested TreeBuilder
in a test
It's just slightly simpler to not create a `TreeBuilder` to create a `TreeValue`; we can instead write to the outer builder.
This commit is contained in:
parent
7e6930b56f
commit
6b3fa3ee79
1 changed files with 7 additions and 10 deletions
|
@ -149,17 +149,14 @@ fn test_checkout_file_transitions(use_git: bool) {
|
|||
TreeValue::Symlink(id)
|
||||
}
|
||||
Kind::Tree => {
|
||||
let mut sub_tree_builder = store.tree_builder(store.empty_tree_id().clone());
|
||||
let file_path = path.join(&RepoPathComponent::from("file"));
|
||||
write_path(
|
||||
settings,
|
||||
repo,
|
||||
&mut sub_tree_builder,
|
||||
Kind::Normal,
|
||||
&file_path,
|
||||
);
|
||||
let id = sub_tree_builder.write_tree();
|
||||
TreeValue::Tree(id)
|
||||
let id = testutils::write_file(store, &file_path, "normal file contents");
|
||||
let value = TreeValue::File {
|
||||
id,
|
||||
executable: false,
|
||||
};
|
||||
tree_builder.set(file_path, value);
|
||||
return;
|
||||
}
|
||||
Kind::GitSubmodule => {
|
||||
let mut tx = repo.start_transaction(settings, "test");
|
||||
|
|
Loading…
Reference in a new issue