Expand description
Clean and smudge filters for git-lfs.
See docs/spec.md § “Intercepting Git” for the protocol contract.
Structs§
- Clean
Extension - One pointer extension’s clean side.
- Smudge
Extension - One pointer extension’s smudge side. Mirrors
crate::CleanExtension— separate types because clean/smudge commands are distinct config keys (lfs.extension.<name>.cleanvs.smudge) and different code paths consume them.
Enums§
- Clean
Error - Clean
Outcome - Result of running the
cleanfilter on a piece of input. - Filter
Process Error - Smudge
Error - Smudge
Outcome - Result of running the
smudgefilter on a piece of input.
Functions§
- build_
pointer_ with_ extensions - Run
inputthrough the configuredextensionschain in priority order and return the resultingPointerwithout inserting the final stage’s output anywhere. Used bygit lfs pointer --file=Xto preview whatcleanwould emit, including theext-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) tooutput. - 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) tooutput. - smudge_
object_ to - Stream the working-tree content for an already-parsed
pointertooutput. Used bypullandcheckout, which have the pointer in hand from the index walk.spawn_cwdis the working directory each extension subprocess runs from — passSome(work_tree_root)from pull/checkout (so agit lfs pullinvoked from a subdirectory still finds.git/); the smudge filter (called by git from the work-tree root) can passNoneto inherit the parent’s cwd. - smudge_
with_ fetch - Like
smudge, but on a missing-object miss invokesfetchto populate the store, then streams the freshly-fetched bytes tooutput.
Type Aliases§
- Fetch
Error - Boxed error returned by the on-demand fetch closure passed to
smudge_with_fetch/filter_process.