refactor: remove dead code
This commit is contained in:
parent
717cc8b0bc
commit
b7e864e5c2
2 changed files with 2 additions and 34 deletions
|
@ -4,7 +4,7 @@ use std::sync::{atomic::AtomicBool, Arc, Mutex};
|
||||||
use derive_more::Deref as _;
|
use derive_more::Deref as _;
|
||||||
|
|
||||||
pub mod open;
|
pub mod open;
|
||||||
mod real;
|
// mod real;
|
||||||
mod test;
|
mod test;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -19,7 +19,7 @@ pub use open::otest::OnPush;
|
||||||
pub use open::OpenRepository;
|
pub use open::OpenRepository;
|
||||||
pub use open::OpenRepositoryLike;
|
pub use open::OpenRepositoryLike;
|
||||||
pub use open::RealOpenRepository;
|
pub use open::RealOpenRepository;
|
||||||
pub use real::RealRepository;
|
// pub use real::RealRepository;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
use crate::repository::test::TestRepository;
|
use crate::repository::test::TestRepository;
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
//
|
|
||||||
#![cfg(not(tarpaulin_include))]
|
|
||||||
use std::sync::atomic::AtomicBool;
|
|
||||||
|
|
||||||
use crate as git;
|
|
||||||
use derive_more::Deref as _;
|
|
||||||
use git_next_config::GitDir;
|
|
||||||
|
|
||||||
pub struct RealRepository;
|
|
||||||
impl git::repository::RepositoryLike for RealRepository {
|
|
||||||
fn open(&self, gitdir: &GitDir) -> Result<git::OpenRepository, git::repository::Error> {
|
|
||||||
let gix_repo = gix::ThreadSafeRepository::open(gitdir.to_path_buf())?.to_thread_local();
|
|
||||||
Ok(git::repository::open::real(gix_repo))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tracing::instrument(skip_all)]
|
|
||||||
fn git_clone(
|
|
||||||
&self,
|
|
||||||
repo_details: &git::RepoDetails,
|
|
||||||
) -> Result<git::OpenRepository, git::repository::Error> {
|
|
||||||
tracing::info!("creating");
|
|
||||||
use secrecy::ExposeSecret;
|
|
||||||
let (gix_repo, _outcome) = gix::prepare_clone_bare(
|
|
||||||
repo_details.origin().expose_secret().as_str(),
|
|
||||||
repo_details.gitdir.deref(),
|
|
||||||
)?
|
|
||||||
.fetch_only(gix::progress::Discard, &AtomicBool::new(false))?;
|
|
||||||
tracing::info!("created");
|
|
||||||
|
|
||||||
Ok(git::repository::open::real(gix_repo))
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue