From 7f8641112de8724a565a47b0f0b2a9b826b6baa9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 30 Jan 2017 10:06:08 -0800 Subject: 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 --- attr.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'attr.h') 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, -- cgit v1.2.3