pub fn apply_delta(base: &[u8], delta: &[u8]) -> Result<Vec<u8>>Expand description
Apply a git “patch delta” to base, producing the patched result.
The delta binary format is:
- Source size: variable-length little-endian integer (must equal
base.len()). - Destination size: variable-length little-endian integer.
- A sequence of COPY (MSB set) and INSERT (MSB clear) instructions.
§Errors
Returns Error::CorruptObject if the delta is malformed, the source-size
field does not match base.len(), or the result length does not match the
declared destination size.