libgit2

git_branch_list

Version:

Fill a list with all the branches in the Repository

The string array will be filled with the names of the matching branches; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

Signature

int git_branch_list(git_strarray *branch_names, git_repository *repo, unsigned int list_flags);

Parameters

In
branch_names

Pointer to a git_strarray structure where the branch names will be stored.

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.

Returns

int

0 or an error code.

Versions