From 81edd925236ebae170a9cf58857d524a358b7871 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 28 Jan 2022 19:39:42 -0800 Subject: [PATCH] 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. --- lib/src/repo.rs | 1 - lib/src/workspace.rs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/repo.rs b/lib/src/repo.rs index 8570b3dd3a..6bd633f8cf 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -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(); diff --git a/lib/src/workspace.rs b/lib/src/workspace.rs index 455b82c6f0..4477707142 100644 --- a/lib/src/workspace.rs +++ b/lib/src/workspace.rs @@ -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(), )