From 82ebcd2fd8a2213c559b4e3b85ad260d2c838898 Mon Sep 17 00:00:00 2001 From: dploch Date: Wed, 31 Jul 2024 11:19:17 -0400 Subject: [PATCH] repo: define a public constructor for RepoLoader This enables the creation of Repo objects in environments without standard filesystem support, by allowing the caller to load the store objects however they see fit. This confines interaction with the filesystem to the WorkingCopy abstractions. --- lib/src/repo.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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,