Skip to content

Commit 30b7e1e

Browse files
stefanbellergitster
authored andcommitted
diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bd03329 commit 30b7e1e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

diff.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ enum diff_symbol {
571571
DIFF_SYMBOL_STATS_SUMMARY_INSERTS_DELETES,
572572
DIFF_SYMBOL_STATS_LINE,
573573
DIFF_SYMBOL_WORD_DIFF,
574+
DIFF_SYMBOL_STAT_SEP,
574575
DIFF_SYMBOL_SUBMODULE_ADD,
575576
DIFF_SYMBOL_SUBMODULE_DEL,
576577
DIFF_SYMBOL_SUBMODULE_UNTRACKED,
@@ -766,6 +767,9 @@ static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
766767
case DIFF_SYMBOL_WORD_DIFF:
767768
fprintf(o->file, "%.*s", len, line);
768769
break;
770+
case DIFF_SYMBOL_STAT_SEP:
771+
fputs(o->stat_sep, o->file);
772+
break;
769773
default:
770774
die("BUG: unknown diff symbol");
771775
}
@@ -5077,10 +5081,10 @@ void diff_flush(struct diff_options *options)
50775081
if (output_format & DIFF_FORMAT_PATCH) {
50785082
if (separator) {
50795083
emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0);
5080-
if (options->stat_sep) {
5084+
if (options->stat_sep)
50815085
/* 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);
50845088
}
50855089

50865090
diff_flush_patch_all_file_pairs(options);

0 commit comments

Comments
 (0)