From: Linus Torvalds <torva...@linux-foundation.org>

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.

Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
Signed-off-by: Stefan Beller <sbel...@google.com>
---

 Linus, I assumed your sign off for the original patch. Thanks for spotting.
 
 Adding the mode change to t4016 seems like the easiest way to test it.
 
 Thanks,
 Stefan
  
 diff.c                | 1 +
 t/t4016-diff-quote.sh | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/diff.c b/diff.c
index 3c6a3e0faa..653bb2e72e 100644
--- a/diff.c
+++ b/diff.c
@@ -5272,6 +5272,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);
diff --git a/t/t4016-diff-quote.sh b/t/t4016-diff-quote.sh
index 9c48e5c2c9..514056dd10 100755
--- a/t/t4016-diff-quote.sh
+++ b/t/t4016-diff-quote.sh
@@ -30,6 +30,7 @@ test_expect_success setup '
        git add . &&
        git commit -m initial &&
        git mv "$P0.0" "R$P0.0" &&
+       chmod a+x "R$P0.0" &&
        git mv "$P0.1" "R$P1.0" &&
        git mv "$P0.2" "R$P2.0" &&
        git mv "$P0.3" "R$P3.0" &&
@@ -47,6 +48,7 @@ cat >expect <<\EOF
  rename pathname.2 => Rpathname with SP.0 (100%)
  rename "pathname\twith HT.2" => Rpathname with SP.1 (100%)
  rename pathname.0 => Rpathname.0 (100%)
+ mode change 100644 => 100755
  rename "pathname\twith HT.0" => Rpathname.1 (100%)
 EOF
 '
-- 
2.14.0.rc0.3.g6c2e499285

Reply via email to