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.
Trait Implementations§
Source§impl Clone for CommitData
impl Clone for CommitData
Source§impl Debug for CommitData
impl Debug for CommitData
impl Eq for CommitData
Source§impl PartialEq for CommitData
impl PartialEq for CommitData
impl StructuralPartialEq for CommitData
Auto Trait Implementations§
impl Freeze for CommitData
impl RefUnwindSafe for CommitData
impl Send for CommitData
impl Sync for CommitData
impl Unpin for CommitData
impl UnsafeUnpin for CommitData
impl UnwindSafe for CommitData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.