#[non_exhaustive]pub enum RefStoreError {
LockHeld {
name: String,
},
ExpectedMismatch {
name: String,
expected: Expected,
actual: Option<RawRef>,
},
NameUnavailable {
reason: RefnameUnavailable,
},
DuplicateUpdate {
name: String,
},
SymrefLoop,
NotFound {
name: String,
},
Corrupt(String),
GitDirPathIo {
path: String,
operation: GitDirPathOperation,
os_error: i32,
},
InvalidRefName {
name: String,
},
NullOid {
name: String,
},
InvalidReflog(SignatureError),
Backend(BackendError),
}Expand description
Failure modes for reference store reads and transactions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LockHeld
Another prepared transaction holds the store lock.
ExpectedMismatch
Compare-and-swap or existence check failed for an update.
Fields
A ref name cannot be created because of a directory/file conflict.
DuplicateUpdate
The same ref name appears more than once in one transaction.
SymrefLoop
Symbolic reference resolution exceeded crate::refs::SYMREF_MAXDEPTH.
NotFound
The ref (or the target at the end of its symbolic chain) does not exist.
Corrupt(String)
Stored data for a ref or reflog is malformed.
GitDirPathIo
Filesystem I/O on a git-directory path during ref store work.
Fields
operation: GitDirPathOperationWhat the operation was trying to do when I/O failed.
InvalidRefName
Ref name is not safe to store (traversal, illegal component, etc.).
Every backend checks update names and both sides of reflog and case-only renames
in super::RefStore::prepare, before taking locks.
NullOid
An update would store the all-zero (null) object id as a direct ref value.
The null id names no object, so Git treats such a ref as broken. Delete a ref with
new_value: None instead. Reflog-only updates
(super::RefUpdateFlags::log_only) may still carry the null id.
InvalidReflog(SignatureError)
Reflog identity or message would forge or corrupt a log line.
Backend(BackendError)
A custom backend’s own storage failed (database, network, …).
Built-in backends never return this; their I/O failures stay typed elsewhere.
Implementations§
Source§impl RefStoreError
impl RefStoreError
Trait Implementations§
Source§impl Clone for RefStoreError
impl Clone for RefStoreError
Source§impl Debug for RefStoreError
impl Debug for RefStoreError
Source§impl Display for RefStoreError
impl Display for RefStoreError
impl Eq for RefStoreError
Source§impl Error for RefStoreError
impl Error for RefStoreError
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()