path: root/attr.h
diff options
authorBrandon Williams <>2017-01-28 02:02:02 (GMT)
committerJunio C Hamano <>2017-02-01 21:46:53 (GMT)
commit685b2925757e98624e37abe09d49c205a7db5943 (patch)
tree150d0c50e6b20402baefd7a8442fa1a13851b780 /attr.h
parent1a600b7555205f80b276659db4fd521658642505 (diff)
attr: eliminate global check_all_attr array
Currently there is a reliance on 'check_all_attr' which is a global array of 'attr_check_item' items which is used to store the value of each attribute during the collection process. This patch eliminates this global and instead creates an array per 'attr_check' instance which is then used in the attribute collection process. This brings the attribute system one step closer to being thread-safe. Signed-off-by: Brandon Williams <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'attr.h')
1 files changed, 5 insertions, 0 deletions
diff --git a/attr.h b/attr.h
index 898e1a8..5aaf55c 100644
--- a/attr.h
+++ b/attr.h
@@ -4,6 +4,9 @@
/* An attribute is a pointer to this opaque structure */
struct git_attr;
+/* opaque structure used internally for attribute collection */
+struct all_attrs_item;
* Given a string, return the gitattribute object that
* corresponds to it.
@@ -33,6 +36,8 @@ struct attr_check {
int nr;
int alloc;
struct attr_check_item *items;
+ int all_attrs_nr;
+ struct all_attrs_item *all_attrs;
extern struct attr_check *attr_check_alloc(void);