MCPcopy Index your code
hub / github.com/git/git / copy_pathspec

Function copy_pathspec

pathspec.c:723–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721}
722
723void 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
747void clear_pathspec(struct pathspec *pathspec)
748{

Callers 12

preload_indexFunction · 0.85
setup_revisionsFunction · 0.85
diff_tree_combinedFunction · 0.85
do_diff_cacheFunction · 0.85
get_modified_filesFunction · 0.85
add_files_to_cacheFunction · 0.85
stash_working_treeFunction · 0.85
read_from_treeFunction · 0.85
populate_paths_from_revsFunction · 0.85

Calls 3

xstrdupFunction · 0.85
xstrdup_or_nullFunction · 0.85
attr_check_dupFunction · 0.85

Tested by

no test coverage detected