Skip to main content

apply_patch_fuzzy

Function apply_patch_fuzzy 

Source
pub fn apply_patch_fuzzy(
    original: &str,
    patch: &FilePatch,
    fuzz_factor: usize,
) -> PunchResult<String>
Expand description

Apply a file patch with fuzzy matching — allow hunks to land at a nearby offset.

The fuzz_factor specifies how many lines of offset to search in each direction when a hunk doesn’t land cleanly at its expected position. This is the equivalent of a loose combo that still connects.