Signed-off-by: Stefan Beller <sbel...@google.com>
---
 diff.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/diff.c b/diff.c
index 5b46baa12a..18bfc4720b 100644
--- a/diff.c
+++ b/diff.c
@@ -591,6 +591,7 @@ enum diff_symbol {
        DIFF_SYMBOL_STATS_SUMMARY_INSERTS_DELETES,
        DIFF_SYMBOL_STATS_LINE,
        DIFF_SYMBOL_WORD_DIFF,
+       DIFF_SYMBOL_STAT_SEP,
 };
 /*
  * Flags for content lines:
@@ -776,6 +777,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_STAT_SEP:
+               fputs(o->stat_sep, o->file);
+               break;
        default:
                die("BUG: unknown diff symbol");
        }
@@ -5085,10 +5089,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 (options->stat_sep) {
+                       if (options->stat_sep)
                                /* 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);
-- 
2.12.2.575.gb14f27f917

Reply via email to