mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-31 16:40:22 +00:00
workspace: avoid reloading stores when adding workspace
By calling `repo.loader()` on the existing repo, we reuse the same commit store etc. That should make it easier to add out-of-tree backends by removing one place we'd otherwise need to pass in a way of creating a backend (now we reuse the instance that was already created for the existing `repo`).
This commit is contained in:
parent
ea5aa0a96d
commit
e41acc1c16
1 changed files with 1 additions and 2 deletions
|
@ -162,10 +162,9 @@ impl Workspace {
|
|||
.write_all(repo_dir.to_str().unwrap().as_bytes())
|
||||
.unwrap();
|
||||
|
||||
let repo_loader = RepoLoader::init(user_settings, &repo_dir);
|
||||
let (working_copy, repo) =
|
||||
init_working_copy(user_settings, repo, workspace_root, &jj_dir, workspace_id);
|
||||
let workspace = Workspace::new(workspace_root, working_copy, repo_loader);
|
||||
let workspace = Workspace::new(workspace_root, working_copy, repo.loader());
|
||||
Ok((workspace, repo))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue