libgit2

git_branch_foreach

Version:

Loop over all the branches and issue a callback for each one.

If the callback returns a non-zero value, this will stop looping.

Signature

int git_branch_foreach(git_repository *repo, unsigned int list_flags, git_branch_foreach_cb branch_cb, void *payload);

Parameters

In
repo

Repository where to find the branches.

unsigned int
In
list_flags

Filtering flags for the branch listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE or a combination of the two.

In
branch_cb

Callback to invoke per found branch.

void *
In
payload

Extra parameter to callback function.

Returns

int

0 on success, GIT_EUSER on non-zero callback, or error code

Versions