use std::path::PathBuf;
use thiserror::Error;
use crate::git::GitError;
#[non_exhaustive]
#[derive(Debug, Error)]
pub enum TreeError {
#[error("pack manifest not found at `{0}`")]
ManifestNotFound(PathBuf),
#[error("failed to read pack manifest: {0}")]
ManifestRead(String),
#[error("failed to parse pack manifest at `{path}`: {detail}")]
ManifestParse {
path: PathBuf,
detail: String,
},
#[error("git error during walk: {0}")]
Git(#[from] GitError),
#[error("cycle detected in pack graph: {chain:?}")]
CycleDetected {
chain: Vec<String>,
},
#[error("pack name `{got}` does not match expected `{expected}` for child at `{path}`")]
PackNameMismatch {
got: String,
expected: String,
path: PathBuf,
},
#[error("pack child `{child_name}` has invalid path `{path}`: {reason}")]
ChildPathInvalid {
child_name: String,
path: String,
reason: String,
},
}