workspace: take over creation of .jj/working_copy/ from repo.rs (#13)

It's clearly `Workspace`'s job to create `.jj/working_copy/`, I must
have just forgotten to move it there.
This commit is contained in:
Martin von Zweigbergk 2022-01-28 19:39:42 -08:00
parent c74882b3c0
commit 81edd92523
2 changed files with 3 additions and 2 deletions

View File

@ -153,7 +153,6 @@ impl ReadonlyRepo {
fn init_repo_dir(repo_path: &Path) {
fs::create_dir(repo_path.join("store")).unwrap();
fs::create_dir(repo_path.join("working_copy")).unwrap();
fs::create_dir(repo_path.join("view")).unwrap();
fs::create_dir(repo_path.join("op_store")).unwrap();
fs::create_dir(repo_path.join("op_heads")).unwrap();

View File

@ -58,10 +58,12 @@ fn init_working_copy(
workspace_root: &Path,
jj_dir: &Path,
) -> WorkingCopy {
let working_copy_state_path = jj_dir.join("working_copy");
std::fs::create_dir(&working_copy_state_path).unwrap();
WorkingCopy::init(
repo.store().clone(),
workspace_root.to_path_buf(),
jj_dir.join("working_copy"),
working_copy_state_path,
repo.op_id().clone(),
repo.view().checkout().clone(),
)