From 4fd5748c4bbc0fba3db9fb2fb20e01261339b9d9 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sun, 21 Jul 2019 14:11:03 +0100 Subject: attr: optionally read attributes from repository When `GIT_ATTR_CHECK_INCLUDE_HEAD` is specified, read `gitattribute` files that are checked into the repository at the HEAD revision. --- include/git2/attr.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/git2') diff --git a/include/git2/attr.h b/include/git2/attr.h index cab9758a0..72e43806c 100644 --- a/include/git2/attr.h +++ b/include/git2/attr.h @@ -119,13 +119,20 @@ GIT_EXTERN(git_attr_value_t) git_attr_value(const char *attr); #define GIT_ATTR_CHECK_INDEX_ONLY 2 /** - * Check attribute flags: Using the system attributes file. + * Check attribute flags: controlling extended attribute behavior. * * Normally, attribute checks include looking in the /etc (or system * equivalent) directory for a `gitattributes` file. Passing this * flag will cause attribute checks to ignore that file. + * equivalent) directory for a `gitattributes` file. Passing the + * `GIT_ATTR_CHECK_NO_SYSTEM` flag will cause attribute checks to + * ignore that file. + * + * Passing the `GIT_ATTR_CHECK_INCLUDE_HEAD` flag will use attributes + * from a `.gitattributes` file in the repository at the HEAD revision. */ -#define GIT_ATTR_CHECK_NO_SYSTEM (1 << 2) +#define GIT_ATTR_CHECK_NO_SYSTEM (1 << 2) +#define GIT_ATTR_CHECK_INCLUDE_HEAD (1 << 3) /** * Look up the value of one git attribute for path. -- cgit v1.2.1