libgit2

git_config_foreach_match

Version:

Perform an operation on each config variable matching a regular expression.

This behaviors like git_config_foreach with an additional filter of a regular expression that filters which config keys are passed to the callback.

Signature

int git_config_foreach_match(const git_config *cfg, const char *regexp, git_config_foreach_cb callback, void *payload);

Parameters

In
cfg

where to get the variables from

const char *
In
regexp

regular expression to match against config names

In
callback

the function to call on each variable

void *
In
payload

the data to pass to the callback

Returns

int

0 or the return value of the callback which didn't return 0

Versions