forked from kemitix/git-next
Paul Campbell
341dc97a51
Repository is now behind an enum to allow selection of a mock Repsitory for use in tests.
20 lines
492 B
Rust
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())
|
|
}
|
|
}
|
|
}
|