git.attribute

Members

Functions

GIT_ATTR_FALSE
bool GIT_ATTR_FALSE(T attr)

GIT_ATTR_FALSE checks if an attribute is set off. In core git parlance, this is the value for attributes that are "Unset" (not to be confused with values that a "Unspecified").

GIT_ATTR_HAS_VALUE
bool GIT_ATTR_HAS_VALUE(T attr)

GIT_ATTR_HAS_VALUE checks if an attribute is set to a value (as opposed to TRUE, FALSE or UNSPECIFIED). This would be the case if for a file with something like:

GIT_ATTR_TRUE
bool GIT_ATTR_TRUE(T attr)

GIT_ATTR_TRUE checks if an attribute is set on. In core git parlance, this the value for "Set" attributes.

GIT_ATTR_UNSPECIFIED
bool GIT_ATTR_UNSPECIFIED(T attr)

GIT_ATTR_UNSPECIFIED checks if an attribute is unspecified. This may be due to the attribute not being mentioned at all or because the attribute was explicitly set unspecified via the ! operator.

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

Add a macro definition.

git_attr_cache_flush
void git_attr_cache_flush(git_repository* repo)

Flush the gitattributes cache.

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

Loop over all the git attributes for a path.

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

Look up the value of one git attribute for path.

git_attr_get_many
int git_attr_get_many(const(char)** values_out, git_repository* repo, uint32_t flags, const(char)* path, size_t num_attr, const(char)** names)

Look up a list of git attributes for path.

Manifest constants

GIT_ATTR_CHECK_FILE_THEN_INDEX
enum GIT_ATTR_CHECK_FILE_THEN_INDEX;

Check attribute flags: Reading values from index and working directory.

GIT_ATTR_CHECK_NO_SYSTEM
enum GIT_ATTR_CHECK_NO_SYSTEM;

Check attribute flags: Using the system attributes file.

Examples

1 auto repo = initRepo(_userRepo, OpenBare.yes);
2 scope(exit) rmdirRecurse(_userRepo);
3 
4 string[] attributes = [
5     "*.c foo"
6 ];
7 
8 std.file.write(buildPath(repo.path, ".gitattributes"), attributes.join());

Meta