libgit2

git_attr_foreach

Version:

Loop over all the git attributes for a path.

Signature

int git_attr_foreach(git_repository *repo, uint32_t flags, const char *path, int (*)(const char *, const char *, void *) callback, void *payload);

Parameters

In
repo

The repository containing the path.

uint32_t
In
flags

A combination of GIT_ATTR_CHECK... flags.

const char *
In
path

The path inside the repo to check attributes. This does not have to exist, but if it does not, then it will be treated as a plain file (i.e. not a directory).

int (*)(const char *, const char *, void *)
In
callback

The function that will be invoked on each attribute and attribute value. The name parameter will be the name of the attribute and the value will be the value it is set to, including possibly NULL if the attribute is explicitly set to UNSPECIFIED using the ! sign. This will be invoked only once per attribute name, even if there are multiple rules for a given file. The highest priority rule will be used.

void *
In
payload

Passed on as extra parameter to callback function.

Returns

int

Versions