pub enum FailureKind {
NonFastForward,
AuthFailed,
CredentialHelperFailed,
MergeConflict,
WouldOverwrite,
HostKeyUnverified,
NetworkUnreachable,
LockExists,
LocalChangesBlockAbort,
Other,
}Expand description
What kind of failure git’s message describes. The frontends map each to a sentence and, where one exists, an action.
Variants§
NonFastForward
The remote has commits this branch lacks: pull first.
AuthFailed
Credentials missing, wrong or refused.
CredentialHelperFailed
The configured credential helper itself could not run (a missing
script, a helper not on PATH, a helper that quit): git then sent no
credentials and the remote’s refusal that follows is a consequence,
not the cause. FailureKind::credential_helper_line has the line.
MergeConflict
A merge, rebase or pull stopped on conflicts.
WouldOverwrite
Local changes would be overwritten: commit, stash or discard.
HostKeyUnverified
ssh does not know the remote’s host key and could not ask: connect once in a terminal to verify and add it.
NetworkUnreachable
The remote could not be reached.
LockExists
Another git process holds index.lock (or another lock file).
LocalChangesBlockAbort
An abort refused because files have local changes it would overwrite
(ConflictRefusal::LocalChanges). Never read from text: the typed
error sets it.
Other
Implementations§
Source§impl FailureKind
impl FailureKind
Sourcepub fn classify(stderr: &str) -> FailureKind
pub fn classify(stderr: &str) -> FailureKind
Classifies git’s English stderr. Order matters: the specific “would be overwritten” and lock messages come before the broad ones.
Source§impl FailureKind
impl FailureKind
Sourcepub fn credential_helper_line(stderr: &str) -> Option<String>
pub fn credential_helper_line(stderr: &str) -> Option<String>
The stderr line that shows a credential helper failing to run, for a
FailureKind::CredentialHelperFailed reading (None otherwise).