Skip to content

Commit

Permalink
repo: define a public constructor for RepoLoader
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
torquestomp committed Jul 31, 2024
1 parent b2b8682 commit 82ebcd2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 82ebcd2

Please sign in to comment.