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

Function diffstat_add

diff.c:2802–2820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2800}
2801
2802static struct diffstat_file *diffstat_add(struct diffstat_t *diffstat,
2803 const char *name_a,
2804 const char *name_b)
2805{
2806 struct diffstat_file *x;
2807 CALLOC_ARRAY(x, 1);
2808 ALLOC_GROW(diffstat->files, diffstat->nr + 1, diffstat->alloc);
2809 diffstat->files[diffstat->nr++] = x;
2810 if (name_b) {
2811 x->from_name = xstrdup(name_a);
2812 x->name = xstrdup(name_b);
2813 x->is_renamed = 1;
2814 }
2815 else {
2816 x->from_name = NULL;
2817 x->name = xstrdup(name_a);
2818 }
2819 return x;
2820}
2821
2822static int diffstat_consume(void *priv, char *line, unsigned long len)
2823{

Callers 1

builtin_diffstatFunction · 0.85

Calls 1

xstrdupFunction · 0.85

Tested by

no test coverage detected