git-next/crates/git/src/fetch.rs
Paul Campbell 341dc97a51 refactor(git): add mock repository and tests
Repository is now behind an enum to allow selection of a mock Repsitory
for use in tests.
2024-05-21 19:47:01 +01:00

20 lines
492 B
Rust

#[derive(Debug, derive_more::Display)]
pub enum Error {
UnableToOpenRepo(String),
NoFetchRemoteFound,
Connect(String),
Fetch(String),
Lock,
}
impl std::error::Error for Error {}
mod gix_error {
#![cfg(not(tarpaulin_include))] // third-party library errors
use super::Error;
impl From<gix::remote::connect::Error> for Error {
fn from(gix_error: gix::remote::connect::Error) -> Self {
Self::Connect(gix_error.to_string())
}
}
}