| 2800 | } |
| 2801 | |
| 2802 | static 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 | |
| 2822 | static int diffstat_consume(void *priv, char *line, unsigned long len) |
| 2823 | { |
no test coverage detected