pub fn compute_patch_ids_from_text(
algo: HashAlgo,
input: &[u8],
mode: PatchIdMode,
) -> Vec<(ObjectId, ObjectId)>Expand description
Compute patch-IDs from unified diff text (e.g. git log -p output).
Parses the text line by line. Each time a commit <oid> or
From <oid> … marker is found the accumulated hash for the previous patch
is finalised and emitted as (patch_id, commit_id). Commits with no diff
content (empty patches, merge commits) are silently skipped.
§Parameters
algo— object hash algorithm (must match the repository that produced the diff).input— raw bytes of the unified diff stream.mode— which patch-ID algorithm to use (seePatchIdMode).
§Returns
A Vec of (patch_id, commit_id) pairs in the order they were encountered
in the stream.