aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-09-27 15:51:26 -0700
committerJunio C Hamano <gitster@pobox.com>2017-09-28 13:15:59 +0900
commit58aaced4442a6daae1c82318f3f9259001714505 (patch)
tree07533df7a29931396385cc552eafe62cc2ef42d5 /diff.c
parent61e89eaae8824926dc03c47e6ab3aa990b5b832e (diff)
downloadgit-58aaced4442a6daae1c82318f3f9259001714505.tar.gz
git-58aaced4442a6daae1c82318f3f9259001714505.tar.xz
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 <torvalds@linux-foundation.org> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 4af73a7e0..0c604726c 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);