path: root/attr.h
diff options
authorJunio C Hamano <>2017-01-30 18:06:08 (GMT)
committerJunio C Hamano <>2017-02-01 21:46:52 (GMT)
commit7f8641112de8724a565a47b0f0b2a9b826b6baa9 (patch)
treea543fba28417ba7e054d11f812f53ce8c33cf60e /attr.h
parent37293768d0482f41c5aa7d34cf91b03fdfee9d4e (diff)
attr: convert git_all_attrs() to use "struct attr_check"
This updates the other two ways the attribute check is done via an array of "struct attr_check_item" elements. These two niches appear only in "git check-attr". * The caller does not know offhand what attributes it wants to ask about and cannot use attr_check_initl() to prepare the attr_check structure. * The caller may not know what attributes it wants to ask at all, and instead wants to learn everything that the given path has. Such a caller can call attr_check_alloc() to allocate an empty attr_check, and then call attr_check_append() to add attribute names one by one. Signed-off-by: Junio C Hamano <> Signed-off-by: Stefan Beller <> Signed-off-by: Brandon Williams <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'attr.h')
1 files changed, 3 insertions, 6 deletions
diff --git a/attr.h b/attr.h
index e611b13..9f27298 100644
--- a/attr.h
+++ b/attr.h
@@ -56,13 +56,10 @@ int git_check_attrs(const char *path, int, struct attr_check_item *);
extern int git_check_attr(const char *path, struct attr_check *check);
- * Retrieve all attributes that apply to the specified path. *num
- * will be set to the number of attributes on the path; **check will
- * be set to point at a newly-allocated array of git_attr_check
- * objects describing the attributes and their values. *check must be
- * free()ed by the caller.
+ * Retrieve all attributes that apply to the specified path.
+ * check holds the attributes and their values.
-int git_all_attrs(const char *path, int *num, struct attr_check_item **check);
+extern void git_all_attrs(const char *path, struct attr_check *check);
enum git_attr_direction {