libgit2

git_attr_get

Version:

Look up the value of one git attribute for path.

Signature

int git_attr_get(const char **value_out, git_repository *repo, uint32_t flags, const char *path, const char *name);

Parameters

const char **
In
value_out

Output of the value of the attribute. Use the GIT_ATTR_... macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just use the string value for attributes set to a value. You should NOT modify or free this value.

In
repo

The repository containing the path.

uint32_t
In
flags

A combination of GIT_ATTR_CHECK... flags.

const char *
In
path

The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory).

const char *
In
name

The name of the attribute to look up.

Returns

int

0 or an error code.

Versions