提交 f8b6809d 编写于 作者: J Junio C Hamano

Fix "quote" misconversion for rewrite diff output.

663af342 (Full rework of
quote_c_style and write_name_quoted.) mistakenly used puts()
when writing out a fixed string when it did not want to add a
terminating LF.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 d794d9e7
......@@ -2716,7 +2716,7 @@ static void diff_summary(struct diff_filepair *p)
break;
default:
if (p->score) {
puts(" rewrite ");
fputs(" rewrite ", stdout);
write_name_quoted(p->two->path, stdout, ' ');
printf("(%d%%)\n", similarity_index(p));
}
......
#!/bin/sh
test_description='rewrite diff'
. ./test-lib.sh
test_expect_success setup '
cat ../../COPYING >test &&
git add test &&
tr 'a-zA-Z' 'n-za-mN-ZA-M' <../../COPYING >test
'
test_expect_success 'detect rewrite' '
actual=$(git diff-files -B --summary test) &&
expr "$actual" : " rewrite test ([0-9]*%)$" || {
echo "Eh? <<$actual>>"
false
}
'
test_done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册