pub enum GitError {
NotRepository,
UnsupportedRepositoryPath,
InvalidPath(RepoPathError),
PathEscapesRepository {
path: String,
},
NotAFile {
path: String,
},
EmptyCommitMessage,
Spawn {
operation: &'static str,
source: Error,
},
CommandFailed {
operation: &'static str,
status: Option<i32>,
stderr: String,
},
Io {
path: PathBuf,
source: Error,
},
SourceTooLarge {
bytes: u64,
},
UnstableSnapshot,
Diff(DiffError),
}Expand description
An error from repository discovery, Git execution, or worktree access.
Variants§
NotRepository
The supplied location is not inside a Git worktree.
UnsupportedRepositoryPath
Git returned a repository root that cannot be represented as UTF-8.
InvalidPath(RepoPathError)
A repository-relative path failed validation.
PathEscapesRepository
A validated path resolved outside the repository root.
NotAFile
A file operation unexpectedly targeted a directory.
EmptyCommitMessage
A commit message was empty or only whitespace.
Spawn
The Git process could not be started or awaited.
Fields
CommandFailed
Git exited unsuccessfully.
stderr is retained for diagnostics, but omitted from Display to
avoid leaking file contents or other sensitive command output.
Fields
Io
A filesystem operation failed.
SourceTooLarge
A source version exceeded the per-file capture limit.
UnstableSnapshot
Repository metadata or worktree content changed during capture.
Diff(DiffError)
Core diff normalization failed.
Trait Implementations§
Source§impl Error for GitError
impl Error for GitError
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()