#[non_exhaustive]pub enum RefError {
Show 18 variants
Invalid {
detail: String,
},
PackedRefsUnexpectedLine {
path: String,
line: String,
},
Lock(RefLockError),
Store(RefStoreError),
Reftable(ReftableError),
DetachedHead,
UnbornHead,
InvalidHead,
HeadNotOnBranch {
branch: String,
},
HeadNotDetached,
LockReleased {
refname: String,
},
QueryNeedsObjectDatabase,
QueryTargetNotCommit {
oid: ObjectId,
},
ReflogUnknownRef {
refname: String,
},
ReflogInvalidSelector {
spec: String,
},
ReflogInvalidIndex {
spec: String,
source: ParseIntError,
},
InvalidReflogExpiry {
value: String,
},
ReflogIndexOutOfRange {
refname: String,
index: usize,
},
}Expand description
Reference failure: ref names and values, packed-refs, ref locks, ref stores (files and
reftable), reflog selectors, and the state of HEAD.
Surfaced on the umbrella as Error::Ref. Branch and tag
porcelain failures have their own areas (Error::Branch,
Error::Tag).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Invalid
A reference name or value is invalid.
PackedRefsUnexpectedLine
A packed-refs line Git would reject when reading the ref database.
Lock(RefLockError)
Reference lock failure while updating refs.
Store(RefStoreError)
Reference store transaction or iteration failure.
Reftable(ReftableError)
Reftable file, stack, or transaction failure.
DetachedHead
create_commit requires a branch checkout.
UnbornHead
HEAD is on a branch with no commits yet, but the operation needs a commit
(Repository::head_commit,
replay_commit).
InvalidHead
HEAD could not be resolved to a branch, detached commit, or unborn branch.
HeadNotOnBranch
HEAD is not a symbolic ref to the branch an update expected it to be on.
HeadNotDetached
A detached-HEAD update found HEAD attached to a branch.
LockReleased
A ref update tried to write through a lock it had already committed or dropped.
QueryNeedsObjectDatabase
A ref query sorted by creator date, or filtered by reachability, without an object database to read commits from.
QueryTargetNotCommit
A ref query’s --contains / --merged / --no-merged target does not peel to a commit.
ReflogUnknownRef
Ref does not exist and has no reflog entries.
ReflogInvalidSelector
A reflog selector is missing its reference or @{n} delimiters.
ReflogInvalidIndex
A reflog selector index is not a nonnegative integer that fits in usize.
Fields
source: ParseIntErrorInteger parsing failure, including overflow.
InvalidReflogExpiry
A reflog expiry (gc.reflogExpire, --expire) is neither never/now/all nor a
date.
ReflogIndexOutOfRange
ref@{{n}} is out of range for the current reflog.
Implementations§
Trait Implementations§
Source§impl Error for RefError
impl Error for RefError
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()