Skip to main content

enumerate_hunks

Function enumerate_hunks 

Source
pub fn enumerate_hunks(
    old_bytes: &[u8],
    new_bytes: &[u8],
) -> Option<Vec<PatchHunk>>
Expand description

Enumerate the hunks between two blobs as structured PatchHunks, using the same Myers diff + git-style compaction as unified_hunks. Returns None when either side is binary (git’s NUL heuristic); an empty vector means the blobs are textually identical. Unlike unified_hunks, which renders bytes, this exposes each hunk’s lines so a caller can let the user pick a subset to stage and rebuild the partial blob with apply_hunks_subset.