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

29 lines
620 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-forward"),
Self::From(from) => write!(f, "force-if-from:{}", from),
}
}
}
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("gix open: {0}")]
Open(#[from] Box<gix::open::Error>),
#[error("io: {0}")]
Push(#[from] std::io::Error),
#[error("lock")]
Lock,
}
pub type Result<T> = core::result::Result<T, Error>;