ok/jj
1
0
Fork 0
forked from mirrors/jj

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.
This commit is contained in:
dploch 2024-07-31 11:19:17 -04:00 committed by Daniel Ploch
parent dc2b5500ff
commit 5f7e3883e8

View file

@ -604,6 +604,26 @@ pub struct RepoLoader {
}
impl RepoLoader {
pub fn new(
repo_path: PathBuf,
repo_settings: RepoSettings,
store: Arc<Store>,
op_store: Arc<dyn OpStore>,
op_heads_store: Arc<dyn OpHeadsStore>,
index_store: Arc<dyn IndexStore>,
submodule_store: Arc<dyn SubmoduleStore>,
) -> 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,