Expand description
Git object model: object IDs, kinds, and in-memory representations.
§Object ID
ObjectId is a 20-byte SHA-1 digest. It implements Display as
lowercase hex, FromStr from a 40-character hex string, and the standard
ordering traits so it can be used as a map key.
§Object Kind
ObjectKind represents the four Git object types: blob, tree, commit,
and tag. The raw header byte-slice is parsed with ObjectKind::from_bytes.
§Parsed objects
Object bundles a kind and its raw (decompressed, header-stripped) byte
content. Higher-level parsed forms (e.g. TreeEntry, CommitData)
live in this module and are produced by fallible TryFrom<&Object>
conversions.
Structs§
- Commit
Data - Parsed representation of a commit object.
- Object
- A decompressed, header-stripped Git object.
- Object
Id - A 20-byte SHA-1 object identifier.
- TagData
- Parsed representation of an annotated tag object.
- Tree
Entry - A single entry in a Git tree object.
Enums§
- Object
Kind - The four Git object types.
Functions§
- parse_
commit - Parse the raw data of a commit object.
- parse_
tag - Parse the raw data of a tag object.
- parse_
tree - Parse the raw data of a tree object into its entries.
- serialize_
commit - Serialize a
CommitDatainto the raw bytes suitable for storage. - serialize_
tag - Serialize a
TagDatainto the raw bytes suitable for storage as a tag object. - serialize_
tree - Build the raw bytes of a tree object from a slice of entries.
- tree_
entry_ cmp - Git’s tree-entry sort comparator.