use miette::Diagnostic;
#[non_exhaustive]
#[derive(Debug, thiserror::Error, Diagnostic)]
pub enum GitBridgeError {
#[error("git error: {0}")]
Git(#[from] git2::Error),
#[error("vcs error: {0}")]
Vcs(#[from] panproto_vcs::VcsError),
#[error("project error: {0}")]
Project(#[from] panproto_project::ProjectError),
#[error("parse error: {0}")]
Parse(#[from] panproto_parse::ParseError),
#[error("repository has no commits")]
EmptyRepository,
#[error("failed to read git object {oid}: {reason}")]
ObjectRead {
oid: String,
reason: String,
},
#[error("file {path} is not valid UTF-8")]
NotUtf8 {
path: String,
},
#[error("blob cache error: {0}")]
BlobCache(String),
#[error("git tree entry name is not valid UTF-8 under parent {parent:?}")]
NonUtf8TreeEntry {
parent: String,
},
}