#[non_exhaustive]pub enum ObjectError {
Show 28 variants
InvalidId {
input: String,
},
HashCollision {
oid: ObjectId,
},
NotFound {
name: String,
},
PromisedMissing {
oid: ObjectId,
},
PromisorFetchFailed {
missing: ObjectId,
failures: Vec<PromisorFetchFailure>,
},
PromisorFetchTooDeep {
limit: u32,
},
Corrupt {
detail: String,
},
PackIndexChecksumMismatch {
path: PathBuf,
mismatch: TrailerMismatch,
},
UnresolvedDeltas {
count: u64,
},
PackDeltaBaseNotWritten {
target: ObjectId,
base: ObjectId,
},
Invalid {
kind: ObjectKind,
check: FsckError,
},
InvalidTreeEntry(TreeEntryError),
InvalidSignature(SignatureError),
UnexpectedKind {
oid: ObjectId,
expected: ObjectKind,
actual: ObjectKind,
},
CommitGraphParentMissing {
commit: ObjectId,
parent: ObjectId,
},
DeltaChainTooDeep {
limit: usize,
},
UnknownType {
name: String,
},
HeaderTooLong {
oid: String,
},
Zlib {
detail: String,
},
#[non_exhaustive] CorruptLoose {
oid: ObjectId,
path: PathBuf,
source: Box<ObjectReadFailure>,
},
#[non_exhaustive] CorruptPacked {
oid: ObjectId,
pack: PathBuf,
offset: u64,
source: Box<ObjectReadFailure>,
},
LooseHashMismatch {
path: String,
real_oid: String,
},
LooseObjectWrite {
path: String,
source: Error,
},
StreamTruncated {
expected: u64,
actual: u64,
},
BitmapWalk(BitmapWalkError),
Midx(MidxError),
Offload(OffloadError),
NoPromisorRemote {
operation: &'static str,
},
}Expand description
Object database failure: loose objects, packs, indexes, commit-graph, multi-pack-index, and promisor (partial clone) objects.
Surfaced on the umbrella as Error::Object.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidId
A supplied object ID string was not valid hex or the wrong length.
HashCollision
SHA-1 object hashing detected a chosen-prefix collision (sha1dc).
NotFound
The requested object does not exist in the object store.
PromisedMissing
A partial-clone promisor object is not present locally and no fetcher ran.
PromisorFetchFailed
Promised objects could not be fetched: every promisor remote was asked, and some
failed. Self::PromisedMissing is used instead when every remote answered
but none had the object.
Fields
failures: Vec<PromisorFetchFailure>One entry per remote that failed, in the order they were tried.
PromisorFetchTooDeep
A promisor fetch triggered further promisor fetches more than limit levels deep.
Corrupt
An object’s stored data is corrupt or malformed.
PackIndexChecksumMismatch
A pack index (.idx) file’s trailing checksum does not match its contents.
Only reported by reads that verify the index trailer, such as
crate::pack::read_pack_index; the checksum of the .pack the index
describes is checked separately.
Fields
mismatch: TrailerMismatchExpected and stored trailer digests.
UnresolvedDeltas
Indexing or unpacking a pack left deltas whose bases are neither in the pack nor in the object database: a thin pack without its bases, or a ref-delta cycle.
PackDeltaBaseNotWritten
A pack being written that is not thin reached a delta before its base: the base is missing from the pack, or the planned deltas form a cycle. The receiver could not resolve that delta, so the pack was abandoned.
Fields
Invalid
crate::objects::Objects::write refused a payload that git fsck would reject;
nothing was written.
Fields
kind: ObjectKindKind the payload was meant to be stored as.
InvalidTreeEntry(TreeEntryError)
crate::objects::Objects::write_tree refused an entry.
InvalidSignature(SignatureError)
A crate::ident::Signature cannot be written as an author, committer or tagger line.
UnexpectedKind
An object exists but has a different kind than the operation requires, such as a tree or blob where a commit was expected.
Fields
expected: ObjectKindThe kind the operation required.
actual: ObjectKindThe kind the object actually has.
CommitGraphParentMissing
A commit-graph write was given a commit whose parent is neither among the commits being written nor in the base graph layers, so its parent edge cannot be encoded.
Fields
DeltaChainTooDeep
In-pack delta resolution exceeded the read-side chain depth limit (guards against cyclic ref-delta chains and unbounded recursion; Git has no read limit).
UnknownType
An unsupported or unknown object type was encountered.
HeaderTooLong
Loose object header type field exceeds Git’s 32-byte limit.
Zlib
A zlib compression or decompression failure.
#[non_exhaustive]CorruptLoose
A loose object file is present but its stored bytes could not be decoded.
Fields
This variant is marked as non-exhaustive
source: Box<ObjectReadFailure>Underlying zlib, header, or I/O failure.
#[non_exhaustive]CorruptPacked
A pack entry names the object but its stored bytes could not be decoded.
Fields
This variant is marked as non-exhaustive
source: Box<ObjectReadFailure>Underlying zlib, header, or I/O failure.
LooseHashMismatch
Loose object bytes hash to a different OID than the file path implies (git fsck / read_loose_object).
Fields
LooseObjectWrite
A prepared loose object could not be written during parallel index staging.
Fields
StreamTruncated
A streamed object write or hash ended before the declared size was read.
Fields
BitmapWalk(BitmapWalkError)
A bitmap reachability walk could not run or could not read the bitmap.
Midx(MidxError)
Multi-pack-index load or write failure.
Offload(OffloadError)
Offloading blobs to a large-object promisor was refused
(Maintenance::offload_blobs).
NoPromisorRemote
The operation fetches objects back from a promisor remote, and the repository
has none: no remote.<name>.promisor = true and no extensions.partialClone.
Nothing was changed.
Implementations§
Source§impl ObjectError
impl ObjectError
Sourcepub fn kind_name(&self) -> &'static str
pub fn kind_name(&self) -> &'static str
Stable snake_case slug for this failure (the former umbrella variant names, so
scripts that branch on Error::kind_name keep working).
Trait Implementations§
Source§impl Debug for ObjectError
impl Debug for ObjectError
Source§impl Display for ObjectError
impl Display for ObjectError
Source§impl Error for ObjectError
impl Error for ObjectError
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()