use super::*; pub struct RealRepository; impl RepositoryLike for RealRepository { fn open(&self, gitdir: &GitDir) -> Result { Ok(open::OpenRepository::Real(open::RealOpenRepository::new( Arc::new(Mutex::new( gix::ThreadSafeRepository::open(gitdir.to_path_buf())?.to_thread_local(), )), ))) } fn git_clone(&self, repo_details: &RepoDetails) -> Result { use secrecy::ExposeSecret; let origin = repo_details.origin(); let (repository, _outcome) = gix::prepare_clone_bare(origin.expose_secret().as_str(), repo_details.gitdir.deref())? .fetch_only(gix::progress::Discard, &AtomicBool::new(false))?; Ok(open::OpenRepository::Real(open::RealOpenRepository::new( Arc::new(Mutex::new(repository)), ))) } }