pub struct EmitEntry {
pub oid: Vec<u8>,
pub stored: EntryBytes,
pub obj_type: ObjType,
pub uncompressed_size: u64,
pub delta_base: u64,
pub offset: u64,
pub recompressed: bool,
pub deltified: bool,
}Expand description
One object to emit: where its stored entry is, and what it deltas against.
Fields§
§oid: Vec<u8>The object id, for REF_DELTA rewriting and for reporting.
stored: EntryBytesThe bytes this entry contributes — header and all.
Normally an EntryBytes::Extent: the stored entry exactly as
received, addressed and not copied. For the entry shapes that cannot be
shipped verbatim — chiefly a delta whose base the caller is not sending —
crate::git_ops::GitStore::emit_set rebuilds the bytes from the
resolved object, hands them over as EntryBytes::Owned, and says so in
Self::recompressed.
obj_type: ObjTypeThe entry type of stored, so a copied delta is
OfsDelta/RefDelta and a rebuilt one is the resolved type.
uncompressed_size: u64Post-resolution size, which is what the entry header carries.
delta_base: u64The base’s archive offset, 0 for none.
offset: u64This entry’s own archive offset — the key other entries name it by.
recompressed: boolstored was rebuilt rather than copied, so its payload was inflated
and re-deflated.
Carried on the entry rather than inferred at emission because nothing
downstream can tell one zlib stream from another: a re-deflate and a copy
produce packs that both pass git index-pack --strict and differ only in
the CPU they cost. This flag is what makes EmitReport::recompressed a
count of what happened instead of a hopeful zero.
deltified: boolstored is a delta this server COMPUTED, against a base the request
does carry — rather than the whole object.
A strict refinement of Self::recompressed, never set without it: such
an entry really was inflated and re-deflated, so it is not copied and
must not be counted as one. What it adds is which rebuild happened,
because the two differ by ~4× on the wire and the receipt is the only
place that difference is visible — a whole rebuild and a computed delta
both pass index-pack --strict and fsck.
Zero for a full clone, for the same reason recompressed is: a
whole-repository request contains every base, so nothing is rebuilt at
all. See crate::delta.