libgit2

git_reference_listcb

Version:

List all the references in the repository, calling a custom callback for each one.

The listed references may be filtered by type, or using a bitwise OR of several types. Use the magic value GIT_REF_LISTALL to obtain all references, including packed ones.

The callback function will be called for each of the references in the repository, and will receive the name of the reference and the payload value passed to this method.

Signature

int git_reference_listcb(git_repository *repo, unsigned int list_flags, int (*)(const char *, void *) callback, void *payload);

Parameters

In
repo

Repository where to find the refs

unsigned int
In
list_flags

Filtering flags for the reference listing.

int (*)(const char *, void *)
In
callback

Function which will be called for every listed ref

void *
In
payload

Additional data to pass to the callback

Returns

int

0 on success; error code otherwise

Versions