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

Function say_patch_name

apply.c:370–388  ·  view source on GitHub ↗

fmt must contain _one_ %s and no other substitution */

Source from the content-addressed store, hash-verified

368
369/* fmt must contain _one_ %s and no other substitution */
370static void say_patch_name(FILE *output, const char *fmt, struct patch *patch)
371{
372 struct strbuf sb = STRBUF_INIT;
373
374 if (patch->old_name && patch->new_name &&
375 strcmp(patch->old_name, patch->new_name)) {
376 quote_c_style(patch->old_name, &sb, NULL, 0);
377 strbuf_addstr(&sb, " => ");
378 quote_c_style(patch->new_name, &sb, NULL, 0);
379 } else {
380 const char *n = patch->new_name;
381 if (!n)
382 n = patch->old_name;
383 quote_c_style(n, &sb, NULL, 0);
384 }
385 fprintf(output, fmt, sb.buf);
386 fputc('\n', output);
387 strbuf_release(&sb);
388}
389
390#define SLOP (16)
391

Callers 3

check_patch_listFunction · 0.85
write_out_one_rejectFunction · 0.85
apply_patchFunction · 0.85

Calls 3

quote_c_styleFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected