2024-05-18 11:41:18 +01:00
|
|
|
use super::GitRef;
|
2024-05-11 19:46:20 +01:00
|
|
|
|
|
|
|
#[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"),
|
2024-05-11 19:46:20 +01:00
|
|
|
Self::From(from) => write!(f, "force-if-from:{}", from),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-04-16 22:21:55 +01:00
|
|
|
|
2024-05-11 19:46:20 +01:00
|
|
|
#[derive(Debug, derive_more::From, derive_more::Display)]
|
2024-05-14 16:28:17 +01:00
|
|
|
pub enum Error {
|
2024-05-11 19:46:20 +01:00
|
|
|
Open(Box<gix::open::Error>),
|
|
|
|
Push,
|
2024-05-18 11:41:18 +01:00
|
|
|
Lock,
|
2024-05-11 19:46:20 +01:00
|
|
|
}
|
2024-05-14 16:28:17 +01:00
|
|
|
impl std::error::Error for Error {}
|
2024-05-11 19:46:20 +01:00
|
|
|
|
2024-05-26 16:51:51 +01:00
|
|
|
pub type Result<T> = core::result::Result<T, Error>;
|