#[non_exhaustive]pub enum GitError {
Show 23 variants
NotFound {
path: PathBuf,
},
RefNotFound {
refname: String,
},
RemoteNotFound {
name: String,
},
ConfigNotFound {
key: String,
},
AmbiguousRef {
refname: String,
},
AlreadyExists {
kind: &'static str,
name: String,
},
CheckedOutBranch {
name: String,
},
Conflict {
path: PathBuf,
},
DetachedHead,
InvalidLineRange {
start: usize,
end: usize,
},
InvalidPath {
path: String,
},
InvalidConfigKey {
key: String,
},
NoMergeBase {
a: String,
b: String,
},
SigningNotSupported,
IdentityMissing {
key: String,
},
InvalidTransport {
kind: String,
},
Network(String),
RemoteAuth {
message: String,
},
PushRejected {
refname: String,
reason: String,
},
CommandFailed {
args: Vec<String>,
exit_code: Option<i32>,
stdout: String,
stderr: String,
stdout_truncated: bool,
stderr_truncated: bool,
},
InvalidOid {
value: String,
},
NotImplemented {
operation: &'static str,
},
Internal(Error),
}Expand description
Git domain errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound
Repository not found at path.
RefNotFound
Git reference not found.
RemoteNotFound
Remote not found.
ConfigNotFound
Config key not found.
AmbiguousRef
Ambiguous git reference.
AlreadyExists
Existing resource conflict.
CheckedOutBranch
Attempted to delete the currently checked out branch.
Conflict
Merge conflict in a file.
DetachedHead
HEAD is detached (not pointing to a branch).
InvalidLineRange
Invalid blame line range.
InvalidPath
Invalid repository path.
InvalidConfigKey
Invalid git config key.
NoMergeBase
No merge base exists between the two commits.
SigningNotSupported
Commit signing is not supported by the selected backend.
IdentityMissing
Git author/committer identity is not configured.
libgit2 cannot build a default signature because user.name and/or
user.email are unset in the effective git configuration. This is an
actionable configuration problem, not an internal failure.
InvalidTransport
Unsupported transport configuration.
Network(String)
Network error during remote operations.
RemoteAuth
Authentication or authorization failure during a remote operation.
libgit2 reports the transport-level failure (bad credentials, expired
token, insufficient scope/permission) via an Auth code or an
Http/Ssh/Callback class. This is an actionable access problem, not
an internal failure, so its (credential-redacted) message is surfaced to
the user.
PushRejected
The remote rejected the push of one or more references.
Covers a non-fast-forward update, a protected-branch/hook rejection, and any other server-reported ref rejection. The rejection is reported by the remote (not an internal failure), so the offending ref and the (credential-redacted) reason are surfaced to the user.
Fields
CommandFailed
Git CLI command failure.
Fields
InvalidOid
Invalid object ID string.
NotImplemented
Operation is intentionally not implemented.
Internal(Error)
Internal git2 error.
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()