Skip to main content

parse_commit

Function parse_commit 

Source
pub fn parse_commit(bytes: &[u8], format: ObjectFormat) -> Option<CommitFields>
Expand description

What: The tree, parents and message of a commit object’s content; None for a header with an encoding line (Git would re-encode the message) or a malformed one. Why: show --format=%s prints the message converted to UTF-8; only a commit that needs no conversion is read here.

In TS you’d write (pseudocode):

function parseCommit(bytes: Uint8Array, format): CommitFields | undefined;