aboutsummaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/attr.c b/attr.c
index 5493bff22..7e2134471 100644
--- a/attr.c
+++ b/attr.c
@@ -603,6 +603,23 @@ struct attr_check *attr_check_initl(const char *one, ...)
return check;
}
+struct attr_check *attr_check_dup(const struct attr_check *check)
+{
+ struct attr_check *ret;
+
+ if (!check)
+ return NULL;
+
+ ret = attr_check_alloc();
+
+ ret->nr = check->nr;
+ ret->alloc = check->alloc;
+ ALLOC_ARRAY(ret->items, ret->nr);
+ COPY_ARRAY(ret->items, check->items, ret->nr);
+
+ return ret;
+}
+
struct attr_check_item *attr_check_append(struct attr_check *check,
const struct git_attr *attr)
{