libgit2

git_reference_list

Version:

Fill a list with all the references that can be found in a repository.

Using the list_flags parameter, the listed references may be filtered by type (GIT_REF_OID or GIT_REF_SYMBOLIC) or using a bitwise OR of git_ref_t values. To include packed refs, include GIT_REF_PACKED. For convenience, use the value GIT_REF_LISTALL to obtain all references, including packed ones.

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

Signature

int git_reference_list(git_strarray *array, git_repository *repo, unsigned int list_flags);

Parameters

In
array

Pointer to a git_strarray structure where the reference names will be stored

In
repo

Repository where to find the refs

unsigned int
In
list_flags

Filtering flags for the reference listing

Returns

int

0 or an error code

Versions