use std::path::PathBuf;
use thiserror::Error;
#[non_exhaustive]
#[derive(Debug, Error)]
pub enum GitError {
#[error("destination `{0}` is not empty")]
DestinationNotEmpty(PathBuf),
#[error("path `{0}` is not a git repository")]
NotARepository(PathBuf),
#[error("ref `{0}` not found in repository")]
RefNotFound(String),
#[error("working tree has uncommitted changes at `{0}`")]
DirtyWorkingTree(PathBuf),
#[error("clone from `{url}` failed: {detail}")]
CloneFailed {
url: String,
detail: String,
},
#[error("fetch failed at `{0}`: {1}")]
FetchFailed(PathBuf, String),
#[error("checkout of `{r#ref}` failed: {detail}")]
CheckoutFailed {
r#ref: String,
detail: String,
},
#[error("gix internal error: {0}")]
Internal(String),
}