diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP

Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Jun 29, 2017 at 17:07 UTC 30b7e1e7ef8e859a92b91596560f0d4bb039e5e9
1 file changed +7 -3
diff.c
+7 -3
@@ -571,6 +571,7 @@ enum diff_symbol {
571 DIFF_SYMBOL_STATS_SUMMARY_INSERTS_DELETES,
572 DIFF_SYMBOL_STATS_LINE,
573 DIFF_SYMBOL_WORD_DIFF,
574 + DIFF_SYMBOL_STAT_SEP,
575 DIFF_SYMBOL_SUBMODULE_ADD,
576 DIFF_SYMBOL_SUBMODULE_DEL,
577 DIFF_SYMBOL_SUBMODULE_UNTRACKED,
@@ -766,6 +767,9 @@ static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
767 case DIFF_SYMBOL_WORD_DIFF:
768 fprintf(o->file, "%.*s", len, line);
769 break;
770 + case DIFF_SYMBOL_STAT_SEP:
771 + fputs(o->stat_sep, o->file);
772 + break;
773 default:
774 die("BUG: unknown diff symbol");
775 }
@@ -5077,10 +5081,10 @@ void diff_flush(struct diff_options *options)
5081 if (output_format & DIFF_FORMAT_PATCH) {
5082 if (separator) {
5083 emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0);
5080 - if (options->stat_sep) {
5084 + if (options->stat_sep)
5085 /* attach patch instead of inline */
5082 - fputs(options->stat_sep, options->file);
5083 - }
5086 + emit_diff_symbol(options, DIFF_SYMBOL_STAT_SEP,
5087 + NULL, 0, 0);
5088 }
5089
5090 diff_flush_patch_all_file_pairs(options);