Skip to main content

Module objects

Module objects 

Source
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§

CommitData
Parsed representation of a commit object.
Object
A decompressed, header-stripped Git object.
ObjectId
A 20-byte SHA-1 object identifier.
TagData
Parsed representation of an annotated tag object.
TreeEntry
A single entry in a Git tree object.

Enums§

ObjectKind
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 CommitData into the raw bytes suitable for storage.
serialize_tag
Serialize a TagData into 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.