summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 3a2a175c7e..77c09a87b0 100644
--- a/diff.c
+++ b/diff.c
@@ -1988,6 +1988,9 @@ void diff_flush(struct diff_options *options)
show_stats(diffstat);
free(diffstat);
diffstat = NULL;
+ if (options->summary)
+ for (i = 0; i < q->nr; i++)
+ diff_summary(q->queue[i]);
putchar(options->line_termination);
}
for (i = 0; i < q->nr; i++) {
@@ -2001,7 +2004,7 @@ void diff_flush(struct diff_options *options)
}
for (i = 0; i < q->nr; i++) {
- if (options->summary)
+ if (diffstat && options->summary)
diff_summary(q->queue[i]);
diff_free_filepair(q->queue[i]);
}