libgit2

git_attr_add_macro

Version:

Add a macro definition.

Macros will automatically be loaded from the top level .gitattributes file of the repository (plus the built-in "binary" macro). This function allows you to add others. For example, to add the default macro, you would call:

git_attr_add_macro(repo, "binary", "-diff -crlf");

Signature

int git_attr_add_macro(git_repository *repo, const char *name, const char *values);

Parameters

In
repo

The repository to add the macro in.

const char *
In
name

The name of the macro.

const char *
In
values

The value for the macro.

Returns

int

0 or an error code.

Versions