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

Function combine_diff_path_new

combine-diff.c:1654–1674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1652}
1653
1654struct combine_diff_path *combine_diff_path_new(const char *path,
1655 size_t path_len,
1656 unsigned int mode,
1657 const struct object_id *oid,
1658 size_t num_parents)
1659{
1660 struct combine_diff_path *p;
1661 size_t parent_len = st_mult(sizeof(p->parent[0]), num_parents);
1662
1663 p = xmalloc(st_add4(sizeof(*p), path_len, 1, parent_len));
1664 p->path = (char *)&(p->parent[num_parents]);
1665 memcpy(p->path, path, path_len);
1666 p->path[path_len] = 0;
1667 p->next = NULL;
1668 p->mode = mode;
1669 oidcpy(&p->oid, oid);
1670
1671 memset(p->parent, 0, parent_len);
1672
1673 return p;
1674}

Callers 4

emit_pathFunction · 0.85
intersect_pathsFunction · 0.85
run_diff_filesFunction · 0.85
show_modifiedFunction · 0.85

Calls 3

st_multFunction · 0.85
oidcpyFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected