提交 30b7e1e7 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP

Signed-off-by: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 bd033291
...@@ -571,6 +571,7 @@ enum diff_symbol { ...@@ -571,6 +571,7 @@ enum diff_symbol {
DIFF_SYMBOL_STATS_SUMMARY_INSERTS_DELETES, DIFF_SYMBOL_STATS_SUMMARY_INSERTS_DELETES,
DIFF_SYMBOL_STATS_LINE, DIFF_SYMBOL_STATS_LINE,
DIFF_SYMBOL_WORD_DIFF, DIFF_SYMBOL_WORD_DIFF,
DIFF_SYMBOL_STAT_SEP,
DIFF_SYMBOL_SUBMODULE_ADD, DIFF_SYMBOL_SUBMODULE_ADD,
DIFF_SYMBOL_SUBMODULE_DEL, DIFF_SYMBOL_SUBMODULE_DEL,
DIFF_SYMBOL_SUBMODULE_UNTRACKED, DIFF_SYMBOL_SUBMODULE_UNTRACKED,
...@@ -766,6 +767,9 @@ static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s, ...@@ -766,6 +767,9 @@ static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
case DIFF_SYMBOL_WORD_DIFF: case DIFF_SYMBOL_WORD_DIFF:
fprintf(o->file, "%.*s", len, line); fprintf(o->file, "%.*s", len, line);
break; break;
case DIFF_SYMBOL_STAT_SEP:
fputs(o->stat_sep, o->file);
break;
default: default:
die("BUG: unknown diff symbol"); die("BUG: unknown diff symbol");
} }
...@@ -5077,10 +5081,10 @@ void diff_flush(struct diff_options *options) ...@@ -5077,10 +5081,10 @@ void diff_flush(struct diff_options *options)
if (output_format & DIFF_FORMAT_PATCH) { if (output_format & DIFF_FORMAT_PATCH) {
if (separator) { if (separator) {
emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0); emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0);
if (options->stat_sep) { if (options->stat_sep)
/* attach patch instead of inline */ /* attach patch instead of inline */
fputs(options->stat_sep, options->file); emit_diff_symbol(options, DIFF_SYMBOL_STAT_SEP,
} NULL, 0, 0);
} }
diff_flush_patch_all_file_pairs(options); diff_flush_patch_all_file_pairs(options);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册