Merge branch 'nd/diff-flush-before-warning'
authorJunio C Hamano <gitster@pobox.com>
Tue, 13 Feb 2018 21:39:09 +0000 (13:39 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Feb 2018 21:39:09 +0000 (13:39 -0800)
Avoid showing a warning message in the middle of a line of "git
diff" output.

* nd/diff-flush-before-warning:
diff.c: flush stdout before printing rename warnings

diff.c
diff --git a/diff.c b/diff.c
index e5c5cc4605af689ab5c949c0613c755457f06131..21c3838b25be63e632aa3af19eef27dd2eddd976 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -5471,6 +5471,7 @@ N_("you may want to set your %s variable to at least "
 
 void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc)
 {
+       fflush(stdout);
        if (degraded_cc)
                warning(_(degrade_cc_to_c_warning));
        else if (needed)