#[non_exhaustive]pub enum GitError {
DestinationNotEmpty(PathBuf),
NotARepository(PathBuf),
RefNotFound(String),
DirtyWorkingTree(PathBuf),
CloneFailed {
url: String,
detail: String,
},
FetchFailed(PathBuf, String),
CheckoutFailed {
ref: String,
detail: String,
},
Internal(String),
}Expand description
Errors produced by any crate::git::GitBackend implementation.
The enum is #[non_exhaustive] so future slices (credentials, submodules,
partial fetch) can add variants without a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DestinationNotEmpty(PathBuf)
Clone was asked to populate a destination that already contains files.
NotARepository(PathBuf)
Operation was asked to act on a path that does not hold a git repo.
RefNotFound(String)
A ref (branch, tag, or SHA) could not be resolved in the repository.
DirtyWorkingTree(PathBuf)
Checkout refused because the working tree has uncommitted changes.
CloneFailed
Clone failed at the backend layer. detail carries the backend
message verbatim for operator diagnosis.
FetchFailed(PathBuf, String)
Fetch failed at the backend layer.
CheckoutFailed
Checkout of a resolved ref failed to apply to the working tree.
Fields
Internal(String)
Catch-all for unexpected backend errors. Carries the detail string so the caller can log or surface it without losing information.
Trait Implementations§
Source§impl Error for GitError
impl Error for GitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()