Skip to main content

rewrite_commit_object

Function rewrite_commit_object 

Source
pub fn rewrite_commit_object(
    commit: &RawCommit,
    tree_oid: &str,
    parent_oid: &str,
) -> Vec<u8> ⓘ
Expand description

What: Rewrites an unsigned commit onto a new tree and parent, keeping every other byte. Why: The replayed object must differ from the prepared one only in tree and parent, so the message, encoding, identities, and custom headers stay byte-identical.

In TS you’d write (pseudocode):

rewriteCommitObject({ commit, treeOid, parentOid });