pub fn clean<R: Read, W: Write>(
store: &Store,
input: &mut R,
output: &mut W,
) -> Result<CleanOutcome, StoreError>Expand description
Apply the clean filter to input, writing the resulting pointer (or the
pass-through bytes) to output.
Algorithm (matches upstream gitfilter_clean.go):
- Read up to
MAX_POINTER_SIZEbytes. - If those bytes parse as a valid pointer, emit them verbatim
(
CleanOutcome::Passthrough). - Otherwise stream the buffered head + the rest of
inputinto theStore, computing SHA-256 as we go, and emit the canonical encoding of the resulting pointer (CleanOutcome::Stored).