libgit2

git_config_foreach

Version:

Perform an operation on each config variable.

The callback receives the normalized name and value of each variable in the config backend, and the data pointer passed to this function. If the callback returns a non-zero value, the function stops iterating and returns that value to the caller.

The pointers passed to the callback are only valid as long as the iteration is ongoing.

Signature

int git_config_foreach(const git_config *cfg, git_config_foreach_cb callback, void *payload);

Parameters

In
cfg

where to get the variables from

In
callback

the function to call on each variable

void *
In
payload

the data to pass to the callback

Returns

int

0 on success, non-zero callback return value, or error code

Versions