Merge git://git.bogomips.org/git-svn
authorJunio C Hamano <gitster@pobox.com>
Thu, 22 Nov 2007 08:34:49 +0000 (00:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Nov 2007 08:34:49 +0000 (00:34 -0800)
* git://git.bogomips.org/git-svn:
git-svn: allow `info' command to work offline
git-svn: info --url [path]
git-svn info: implement info command
git-svn: extract reusable code into utility functions
t9106: fix a race condition that caused svn to miss modifications

diff.c
t/t4022-diff-rewrite.sh [new file with mode: 0755]
diff --git a/diff.c b/diff.c
index b08d28a5780cf242a4de78e0f5c4007b7041f392..6b54959610db604bfabc15e6edd2b212f16d0c62 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -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));
                }
diff --git a/t/t4022-diff-rewrite.sh b/t/t4022-diff-rewrite.sh
new file mode 100755 (executable)
index 0000000..6de4acb
--- /dev/null
@@ -0,0 +1,26 @@
+#!/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
+