Skip to content

Commit 4e056c9

Browse files
pcloudsgitster
authored andcommitted
diff.c: flush stdout before printing rename warnings
The diff output is buffered in a FILE object and could still be partially buffered when we print these warnings (directly to fd 2). The output is messed up like this worktree.c | 138 +- worktree.h warning: inexact rename detection was skipped due to too many files. | 12 +- wrapper.c | 83 +- It gets worse if the warning is printed after color codes for the graph part are already printed. You'll get a warning in green or red. Flush stdout first, so we can get something like this instead: xdiff/xutils.c | 42 +- xdiff/xutils.h | 4 +- 1033 files changed, 150824 insertions(+), 69395 deletions(-) warning: inexact rename detection was skipped due to too many files. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 27dea46 commit 4e056c9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4623,6 +4623,7 @@ static const char rename_limit_advice[] =
46234623

46244624
void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc)
46254625
{
4626+
fflush(stdout);
46264627
if (degraded_cc)
46274628
warning(degrade_cc_to_c_warning);
46284629
else if (needed)

0 commit comments

Comments
 (0)