libgit2

git_reference_foreach_glob

Version:

Perform a callback on each reference in the repository whose name matches the given pattern.

This function acts like git_reference_foreach() with an additional pattern match being applied to the reference name before issuing the callback function. See that function for more information.

The pattern is matched using fnmatch or "glob" style where a '*' matches any sequence of letters, a '?' matches any letter, and square brackets can be used to define character ranges (such as "[0-9]" for digits).

Signature

int git_reference_foreach_glob(git_repository *repo, const char *glob, git_reference_foreach_name_cb callback, void *payload);

Parameters

In
repo

Repository where to find the refs

const char *
In
glob

Pattern to match (fnmatch-style) against reference name.

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, GIT_EUSER on non-zero callback, or error code

Versions