pub fn clean<R: Read, W: Write>(
store: &Store,
input: &mut R,
output: &mut W,
path: &str,
extensions: &[CleanExtension],
) -> Result<CleanOutcome, CleanError>Expand description
Apply the clean filter to input, writing the resulting pointer (or the
pass-through bytes) to output.
Algorithm:
- 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
inputthrough each configured extension in priority order, hashing the input to each phase to recordext-N-<name> sha256:<hash>lines, andStore::insertthe final phase’s output.
path is the working-tree path (as passed by git on the command
line / filter-process header). It substitutes for %f in each
extension’s clean command. May be empty when no path is known
(e.g. piped invocation git lfs clean with no -- arg).