//! Errors for the git layer. Converted to `forge_core::Error` at crate boundaries. #[derive(Debug, thiserror::Error)] pub enum Error { #[error("io error: {0}")] Io(#[from] std::io::Error), #[error("git binary unusable: {0}")] Unavailable(String), #[error("git {found} is older than required {required}")] TooOld { found: String, required: String }, #[error("invalid revision or path: {0}")] InvalidInput(String), #[error("git command failed: {0}")] Failed(String), /// A compare-and-swap ref update found the ref at a different value than expected. #[error("ref moved since it was read: {0}")] RefMoved(String), } pub type Result = std::result::Result; impl From for forge_core::Error { fn from(e: Error) -> Self { forge_core::Error::Git(e.to_string()) } }