From 58aaced4442a6daae1c82318f3f9259001714505 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Wed, 27 Sep 2017 15:51:26 -0700 Subject: diff: correct newline in summary for renamed files In 146fdb0dfe (diff.c: emit_diff_symbol learns about DIFF_SYMBOL_SUMMARY, 2017-06-29), the conversion from direct printing to the symbol emission dropped the new line character for renamed, copied and rewritten files. Add the emission of a newline, add a test for this case. Reported-by: Linus Torvalds Helped-by: Jeff King Signed-off-by: Stefan Beller Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- diff.c | 1 + 1 file changed, 1 insertion(+) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 4af73a7e0c..0c604726c0 100644 --- a/diff.c +++ b/diff.c @@ -5251,6 +5251,7 @@ static void show_mode_change(struct diff_options *opt, struct diff_filepair *p, strbuf_addch(&sb, ' '); quote_c_style(p->two->path, &sb, NULL, 0); } + strbuf_addch(&sb, '\n'); emit_diff_symbol(opt, DIFF_SYMBOL_SUMMARY, sb.buf, sb.len, 0); strbuf_release(&sb); -- cgit v1.2.1