git-next/crates/git/src/push.rs

26 lines
570 B
Rust
Raw Normal View History

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 {
2024-05-19 09:44:59 +01:00
Self::No => write!(f, "fast-forward"),
Self::From(from) => write!(f, "force-if-from:{}", from),
}
}
}
#[derive(Debug, derive_more::From, derive_more::Display)]
2024-05-14 16:28:17 +01:00
pub enum Error {
Open(Box<gix::open::Error>),
Push,
Lock,
}
2024-05-14 16:28:17 +01:00
impl std::error::Error for Error {}
pub type Result<T> = core::result::Result<T, Error>;