diff --git a/lib/src/repo.rs b/lib/src/repo.rs index 216a2d12a6..078f276624 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -604,6 +604,26 @@ pub struct RepoLoader { } impl RepoLoader { + pub fn new( + repo_path: PathBuf, + repo_settings: RepoSettings, + store: Arc, + op_store: Arc, + op_heads_store: Arc, + index_store: Arc, + submodule_store: Arc, + ) -> Self { + Self { + repo_path, + repo_settings, + store, + op_store, + op_heads_store, + index_store, + submodule_store, + } + } + pub fn init( user_settings: &UserSettings, repo_path: &Path, diff --git a/lib/src/workspace.rs b/lib/src/workspace.rs index 4cd5c8a55f..6a66ae9525 100644 --- a/lib/src/workspace.rs +++ b/lib/src/workspace.rs @@ -131,17 +131,29 @@ fn init_working_copy( } impl Workspace { - fn new( + pub fn new( workspace_root: &Path, working_copy: Box, repo_loader: RepoLoader, ) -> Result { let workspace_root = workspace_root.canonicalize().context(workspace_root)?; - Ok(Workspace { + Ok(Self::new_no_canonicalize( + workspace_root, + working_copy, + repo_loader, + )) + } + + pub fn new_no_canonicalize( + workspace_root: PathBuf, + working_copy: Box, + repo_loader: RepoLoader, + ) -> Self { + Self { workspace_root, repo_loader, working_copy, - }) + } } pub fn init_local(