summaryrefslogtreecommitdiff
path: root/attr.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-01-30 10:06:08 -0800
committerJunio C Hamano <gitster@pobox.com>2017-02-01 13:46:52 -0800
commit7f8641112de8724a565a47b0f0b2a9b826b6baa9 (patch)
treea543fba28417ba7e054d11f812f53ce8c33cf60e /attr.h
parent37293768d0482f41c5aa7d34cf91b03fdfee9d4e (diff)
downloadgit-7f8641112de8724a565a47b0f0b2a9b826b6baa9.tar.gz
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 <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'attr.h')
-rw-r--r--attr.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/attr.h b/attr.h
index e611b139af..9f2729842d 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 {
GIT_ATTR_CHECKIN,