MCPcopy Create free account
hub / github.com/git/git / show_numstat

Function show_numstat

diff.c:3243–3278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3241}
3242
3243static void show_numstat(struct diffstat_t *data, struct diff_options *options)
3244{
3245 int i;
3246
3247 if (data->nr == 0)
3248 return;
3249
3250 for (i = 0; i < data->nr; i++) {
3251 struct diffstat_file *file = data->files[i];
3252
3253 fprintf(options->file, "%s", diff_line_prefix(options));
3254
3255 if (file->is_binary)
3256 fprintf(options->file, "-\t-\t");
3257 else
3258 fprintf(options->file,
3259 "%"PRIuMAX"\t%"PRIuMAX"\t",
3260 file->added, file->deleted);
3261 if (options->line_termination) {
3262 fill_print_name(file);
3263 if (!file->is_renamed)
3264 write_name_quoted(file->name, options->file,
3265 options->line_termination);
3266 else {
3267 fputs(file->print_name, options->file);
3268 putc(options->line_termination, options->file);
3269 }
3270 } else {
3271 if (file->is_renamed) {
3272 putc('\0', options->file);
3273 write_name_quoted(file->from_name, options->file, '\0');
3274 }
3275 write_name_quoted(file->name, options->file, '\0');
3276 }
3277 }
3278}
3279
3280struct dirstat_file {
3281 const char *name;

Callers 1

diff_flushFunction · 0.85

Calls 3

diff_line_prefixFunction · 0.85
fill_print_nameFunction · 0.85
write_name_quotedFunction · 0.85

Tested by

no test coverage detected