Merge branch 'jk/quarantine-received-objects'
[gitweb.git] / attr.c
diff --git a/attr.c b/attr.c
index 5493bff224a98361811c1e9fa88bb16efbf85d22..7e2134471cb4afc1b891208ebe4bebd6ad55571d 100644 (file)
--- 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)
 {