libgit2

git_reference_foreach_name

Version:

Perform a callback on the fully-qualified name of each reference.

The callback function will be called for each reference in the repository, receiving the name of the reference and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

Signature

int git_reference_foreach_name(git_repository *repo, git_reference_foreach_name_cb callback, void *payload);

Parameters

In
repo

Repository where to find the refs

In
callback

Function which will be called for every listed ref name

void *
In
payload

Additional data to pass to the callback

Returns

int

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

Versions