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>
This commit is contained in:
Stefan Beller
2017-09-27 15:51:26 -07:00
committed by Junio C Hamano
parent 61e89eaae8
commit 58aaced444
7 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
$ git diff-tree --stat initial mode
file0 | 0
1 file changed, 0 insertions(+), 0 deletions(-)
$

View File

@@ -0,0 +1,3 @@
$ git diff-tree --summary initial mode
mode change 100644 => 100755 file0
$

View File

@@ -0,0 +1,3 @@
$ git diff-tree initial mode
:100644 100755 01e79c32a8c99c557f0757da7cb6d65b3414466d 01e79c32a8c99c557f0757da7cb6d65b3414466d M file0
$

View File

@@ -1,4 +1,10 @@
$ git log --decorate=full --all
commit b7e0bc69303b488b47deca799a7d723971dfa6cd (refs/heads/mode)
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:06:00 2006 +0000
update mode
commit cd4e72fd96faed3f0ba949dc42967430374e2290 (refs/heads/rearrange)
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:06:00 2006 +0000

View File

@@ -1,4 +1,10 @@
$ git log --decorate --all
commit b7e0bc69303b488b47deca799a7d723971dfa6cd (mode)
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:06:00 2006 +0000
update mode
commit cd4e72fd96faed3f0ba949dc42967430374e2290 (rearrange)
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:06:00 2006 +0000