Skip to main content

Crate git_lfs_filter

Crate git_lfs_filter 

Source
Expand description

Clean and smudge filters for git-lfs.

See docs/spec.md § “Intercepting Git” for the protocol contract.

Structs§

CleanExtension
One pointer extension’s clean side.
SmudgeExtension
One pointer extension’s smudge side. Mirrors crate::CleanExtension — separate types because clean/smudge commands are distinct config keys (lfs.extension.<name>.clean vs .smudge) and different code paths consume them.

Enums§

CleanError
CleanOutcome
Result of running the clean filter on a piece of input.
FilterProcessError
SmudgeError
SmudgeOutcome
Result of running the smudge filter on a piece of input.

Functions§

build_pointer_with_extensions
Run input through the configured extensions chain in priority order and return the resulting Pointer without inserting the final stage’s output anywhere. Used by git lfs pointer --file=X to preview what clean would emit, including the ext-N-<name> lines, without polluting the on-disk store.
clean
Apply the clean filter to input, writing the resulting pointer (or the pass-through bytes) to output.
filter_process
Run the filter-process protocol against input/output (typically stdin/stdout). Returns when git closes its end of the pipe.
smudge
Apply the smudge filter to input, writing the working-tree content (or pass-through bytes) to output.
smudge_object_to
Stream the working-tree content for an already-parsed pointer to output. Used by pull and checkout, which have the pointer in hand from the index walk. spawn_cwd is the working directory each extension subprocess runs from — pass Some(work_tree_root) from pull/checkout (so a git lfs pull invoked from a subdirectory still finds .git/); the smudge filter (called by git from the work-tree root) can pass None to inherit the parent’s cwd.
smudge_with_fetch
Like smudge, but on a missing-object miss invokes fetch to populate the store, then streams the freshly-fetched bytes to output.

Type Aliases§

FetchError
Boxed error returned by the on-demand fetch closure passed to smudge_with_fetch / filter_process.