libgit2

git_filter_apply_fn

Deprecated
Version:

Callback to actually perform the data filtering

Specified as filter.apply, this is the callback that actually filters data. If it successfully writes the output, it should return 0. Like check, it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run. Other error codes will stop filter processing and return to the caller.

The payload value will refer to any payload that was set by the check callback. It may be read from or written to as needed.

Deprecations

  • use git_filter_stream_fn

Signature

typedef int git_filter_apply_fn(git_filter *self, void **payload, git_buf *to, const git_buf *from, const git_filter_source *src);

Parameters

In
self

the filter check

void **
In
payload

a data for future filter functions

In
to

the input buffer

In
from

the output buffer

In
src

the filter source

Returns

int

0 on success or a negative value on error

Versions