libgit2

git_pathspec_match_index

Version:

Match a pathspec against entries in an index.

This matches the pathspec against the files in the repository index.

NOTE: At the moment, the case sensitivity of this match is controlled by the current case-sensitivity of the index object itself and the USE_CASE and IGNORE_CASE flags will have no effect. This behavior will be corrected in a future release.

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

Signature

int git_pathspec_match_index(git_pathspec_match_list **out, git_index *index, uint32_t flags, git_pathspec *ps);

Parameters

In
out

Output list of matches; pass NULL to just get return value

In
index

The index to match against

uint32_t
In
flags

Combination of git_pathspec_flag_t options to control match

In
ps

Pathspec to be matched

Returns

int

0 on success, -1 on error, GIT_ENOTFOUND if no matches and the GIT_PATHSPEC_NO_MATCH_ERROR flag is used

Versions