#[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()
Source§impl From<BackendError> for RefStoreError
impl From<BackendError> for RefStoreError
Source§fn from(err: BackendError) -> Self
fn from(err: BackendError) -> Self
Source§impl From<RefStoreError> for Error
impl From<RefStoreError> for Error
Source§fn from(err: RefStoreError) -> Self
fn from(err: RefStoreError) -> Self
Source§fn from(reason: RefnameUnavailable) -> Self
fn from(reason: RefnameUnavailable) -> Self
Source§impl From<SignatureError> for RefStoreError
impl From<SignatureError> for RefStoreError
Source§fn from(source: SignatureError) -> Self
fn from(source: SignatureError) -> Self
Source§impl PartialEq for RefStoreError
impl PartialEq for RefStoreError
impl StructuralPartialEq for RefStoreError
Auto Trait Implementations§
impl !RefUnwindSafe for RefStoreError
impl !UnwindSafe for RefStoreError
impl Freeze for RefStoreError
impl Send for RefStoreError
impl Sync for RefStoreError
impl Unpin for RefStoreError
impl UnsafeUnpin for RefStoreError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.