| 721 | } |
| 722 | |
| 723 | void copy_pathspec(struct pathspec *dst, const struct pathspec *src) |
| 724 | { |
| 725 | int i, j; |
| 726 | |
| 727 | *dst = *src; |
| 728 | DUP_ARRAY(dst->items, src->items, dst->nr); |
| 729 | |
| 730 | for (i = 0; i < dst->nr; i++) { |
| 731 | struct pathspec_item *d = &dst->items[i]; |
| 732 | struct pathspec_item *s = &src->items[i]; |
| 733 | |
| 734 | d->match = xstrdup(s->match); |
| 735 | d->original = xstrdup(s->original); |
| 736 | |
| 737 | DUP_ARRAY(d->attr_match, s->attr_match, d->attr_match_nr); |
| 738 | for (j = 0; j < d->attr_match_nr; j++) { |
| 739 | const char *value = s->attr_match[j].value; |
| 740 | d->attr_match[j].value = xstrdup_or_null(value); |
| 741 | } |
| 742 | |
| 743 | d->attr_check = attr_check_dup(s->attr_check); |
| 744 | } |
| 745 | } |
| 746 | |
| 747 | void clear_pathspec(struct pathspec *pathspec) |
| 748 | { |
no test coverage detected