forked from kemitix/git-next
Paul Campbell
58e991b2b7
Adds a layer around Repository to allow the use of a mock. Mock has still to be implemented.
26 lines
599 B
Rust
26 lines
599 B
Rust
use super::GitRef;
|
|
|
|
#[derive(Debug)]
|
|
pub enum Force {
|
|
No,
|
|
From(GitRef),
|
|
}
|
|
impl std::fmt::Display for Force {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
Self::No => write!(f, "fast-foward"),
|
|
Self::From(from) => write!(f, "force-if-from:{}", from),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, derive_more::From, derive_more::Display)]
|
|
pub enum Error {
|
|
Open(Box<gix::open::Error>),
|
|
Fetch(super::fetch::Error),
|
|
Push,
|
|
Lock,
|
|
}
|
|
impl std::error::Error for Error {}
|
|
|
|
pub type Result = core::result::Result<(), Error>;
|