pub struct CommitData {
pub tree: ObjectId,
pub parents: Vec<ObjectId>,
pub author: String,
pub committer: String,
pub author_raw: Vec<u8>,
pub committer_raw: Vec<u8>,
pub encoding: Option<String>,
pub message: String,
pub raw_message: Option<Vec<u8>>,
pub extra_headers: Vec<u8>,
}Expand description
Parsed representation of a commit object.
This is the read-side shape (it round-trips stored bytes exactly). To create a
new commit, build a NewCommit and pass it to
Objects::write_commit.
Fields§
§tree: ObjectIdThe tree this commit points to.
parents: Vec<ObjectId>Parent commit IDs (zero or more).
Author field decoded to Unicode (using encoding when present, else UTF-8).
committer: StringCommitter field decoded to Unicode.
Exact author header payload bytes as stored in the object (after author ).
Empty means treat Self::author as UTF-8 when serializing (new commits).
committer_raw: Vec<u8>Exact committer header payload bytes as stored in the object.
encoding: Option<String>Optional encoding override (e.g. "UTF-8").
message: StringCommit message (everything after the blank line).
raw_message: Option<Vec<u8>>Optional raw message bytes for non-UTF-8 commit messages.
When set, serialize_commit uses these bytes instead of message.
Optional raw message bytes for non-UTF-8 messages.
extra_headers: Vec<u8>Raw bytes for headers not represented in the fields above (gpgsig, mergetag, …),
including each line’s trailing \n and any continuation lines (leading space).
serialize_commit always emits tree, parent, author, committer, and encoding
from the structured fields, then appends these bytes before the blank line and message.