#[non_exhaustive]pub enum CommitError {
Show 14 variants
EmptyCommitMessage,
CommitPathsRequired,
PartialCommitDuringMerge,
PartialCommitDuringReplay,
NothingToCommit,
NothingStagedToCommit {
unstaged: usize,
untracked: usize,
},
AmendUnborn,
InvalidIdentity(CommitIdentityError),
Identity(IdentityError),
Signing {
program: String,
status: Option<i32>,
stderr: Box<String>,
},
HunkSelect(HunkSelectError),
PatchApply(ApplyError),
InvalidCommitMessage,
ChangeId(ChangeIdError),
}Expand description
Commit, identity, signing, and patch-scoped commit failures.
Wrapped by Error::Commit. Stable kind_name
slugs match the former umbrella variant names for scripts and the CLI error map.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyCommitMessage
A commit was requested with an empty message body after normalization.
CommitPathsRequired
[crate::porcelain::commit::commit_with_scope] was called with an empty
CommitScope::Paths pathspec list.
PartialCommitDuringMerge
crate::porcelain::commit::CommitScope::Paths was used while a merge is in progress.
PartialCommitDuringReplay
Partial commit, amend, or patch commit while a cherry-pick or revert is in progress.
NothingToCommit
The index tree matches the parent commit tree and allow_empty is false.
NothingStagedToCommit
No staged changes for a staged-only commit, but the work tree has unstaged or untracked paths.
Fields
AmendUnborn
CommitRequest::amend on an unborn branch.
InvalidIdentity(CommitIdentityError)
Author or committer on crate::porcelain::commit::CommitRequest is invalid.
Identity(IdentityError)
No usable author or committer identity is configured.
Signing
Commit or tag signing failed.
Fields
HunkSelect(HunkSelectError)
Hunk id resolution failed during a patch-scoped commit.
PatchApply(ApplyError)
Patch apply failed after hunk resolution.
InvalidCommitMessage
Commit message bytes are not valid UTF-8 after normalization.
ChangeId(ChangeIdError)
Change-id generation failed for a new commit.
Implementations§
Source§impl CommitError
impl CommitError
Sourcepub fn kind_name(&self) -> &'static str
pub fn kind_name(&self) -> &'static str
Stable snake_case slug for this failure (matches former Error::kind_name values).
Source§impl CommitError
impl CommitError
Sourcepub fn signing_from_message(message: String) -> Self
pub fn signing_from_message(message: String) -> Self
Build Self::Signing when only a free-form summary is available (program and status unknown).
Trait Implementations§
Source§impl Debug for CommitError
impl Debug for CommitError
Source§impl Display for CommitError
impl Display for CommitError
Source§impl Error for CommitError
impl Error for CommitError
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()