Skip to main content

reverse_file_patch

Function reverse_file_patch 

Source
pub fn reverse_file_patch(patch: &FilePatch) -> FilePatch
Expand description

Reverse a file patch (git apply -R): swap the old/new names, modes, hunk ranges, and no-newline flags, exchange add↔delete status, and flip every Insert/Delete line. Applying the result undoes the original patch.