Expand description
git-object — Git’s object model: commits, trees, tags, and the raw encoded object framing they share.
This crate carries the in-memory representations of Git’s four object types
(Commit, Tree, Tag, and the blob payload carried inside
EncodedObject) together with their parse/serialize routines and the
parse_framed_object helper that decodes the "<type> <len>\0<body>"
loose-object frame.
Commit and Tag are parsed, canonical representations of the headers
this crate understands. They are convenient for structured edits, but they
are not byte-lossless round-trippers for signed objects, custom headers, or
other raw object body details. Use EncodedObject whenever exact object
bytes, object ids, or framed-object bytes must be preserved.
Structs§
- BString
- A byte string for git paths and similar on-disk identifiers.
- Commit
- A parsed, canonical representation of the commit headers this crate understands.
- Commit
Ref - A borrowed parse-view of a raw commit object.
- Encoded
Object - Tag
- A parsed, canonical representation of the annotated tag headers this crate understands.
- TagRef
- A borrowed parse-view of a raw annotated tag object.
- Tree
- Tree
Builder - Builds a single tree level: deduplicates entries by name and emits them in Git’s canonical order so the written object is byte-identical to Git’s.
- Tree
Entries - Fallibly iterates raw tree-object bytes without allocating entry names.
- Tree
Entry - Tree
Entry Ref - A borrowed parse-view of a single entry in a raw tree object.
Enums§
- Entry
Kind - The five entry kinds Git allows inside a tree, each mapping to a fixed mode.
- Object
Type
Functions§
- parse_
framed_ object - tree_
entry_ cmp - Order two tree entries the way Git canonically sorts them: by name bytes,
except that a subtree sorts as though its name ended in
/. Writing a tree whose entries are in any other order produces a different (wrong) OID. - tree_
entry_ object_ type