Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP
author
Stefan Beller
<sbeller@google.com>
Fri, 30 Jun 2017 00:07:04 +0000
(17:07 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 30 Jun 2017 20:13:02 +0000
(13:13 -0700)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
bd03329
)
diff --git
a/diff.c
b/diff.c
index e0d39d04da5c863b3156b4c1a801b0ca7d8e9abe..5a9c55736d6f7ab37b708eb47af5015302467922 100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-571,6
+571,7
@@
enum diff_symbol {
DIFF_SYMBOL_STATS_SUMMARY_INSERTS_DELETES,
DIFF_SYMBOL_STATS_LINE,
DIFF_SYMBOL_WORD_DIFF,
DIFF_SYMBOL_STATS_SUMMARY_INSERTS_DELETES,
DIFF_SYMBOL_STATS_LINE,
DIFF_SYMBOL_WORD_DIFF,
+ DIFF_SYMBOL_STAT_SEP,
DIFF_SYMBOL_SUBMODULE_ADD,
DIFF_SYMBOL_SUBMODULE_DEL,
DIFF_SYMBOL_SUBMODULE_UNTRACKED,
DIFF_SYMBOL_SUBMODULE_ADD,
DIFF_SYMBOL_SUBMODULE_DEL,
DIFF_SYMBOL_SUBMODULE_UNTRACKED,
@@
-766,6
+767,9
@@
static void emit_diff_symbol(struct diff_options *o, enum diff_symbol s,
case DIFF_SYMBOL_WORD_DIFF:
fprintf(o->file, "%.*s", len, line);
break;
case DIFF_SYMBOL_WORD_DIFF:
fprintf(o->file, "%.*s", len, line);
break;
+ case DIFF_SYMBOL_STAT_SEP:
+ fputs(o->stat_sep, o->file);
+ break;
default:
die("BUG: unknown diff symbol");
}
default:
die("BUG: unknown diff symbol");
}
@@
-5077,10
+5081,10
@@
void diff_flush(struct diff_options *options)
if (output_format & DIFF_FORMAT_PATCH) {
if (separator) {
emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0);
if (output_format & DIFF_FORMAT_PATCH) {
if (separator) {
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);