diff options
Diffstat (limited to 'attr.c')
-rw-r--r-- | attr.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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) { |