Abstract out the "name <email> date" handling of commit-tree.c
[gitweb.git] / t / t4003-diff-rename-1.sh
index 9d0e22e17a247e58ef9d9c46688345a03a9e6739..8e3091abb603f9d9a7a456459fac31d4f02e54e7 100644 (file)
@@ -7,14 +7,7 @@ test_description='More rename detection
 
 '
 . ./test-lib.sh
-
-compare_diff_patch () {
-    # When heuristics are improved, the score numbers would change.
-    # Ignore them while comparing.
-    sed -e '/^similarity index [0-9]*%$/d' <"$1" >.tmp-1
-    sed -e '/^similarity index [0-9]*%$/d' <"$2" >.tmp-2
-    diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
-}
+. ../diff-lib.sh ;# test-lib chdir's into trash
 
 test_expect_success \
     'prepare reference tree' \
@@ -47,8 +40,8 @@ copy to COPYING.1
 - HOWEVER, in order to allow a migration to GPLv3 if that seems like
 + However, in order to allow a migration to GPLv3 if that seems like
 diff --git a/COPYING b/COPYING.2
-rename old COPYING
-rename new COPYING.2
+rename from COPYING
+rename to COPYING.2
 --- a/COPYING
 +++ b/COPYING.2
 @@ -2 +2 @@
@@ -78,14 +71,6 @@ test_expect_success \
 
 GIT_DIFF_OPTS=--unified=0 git-diff-cache -C -p $tree >current
 cat >expected <<\EOF
-diff --git a/COPYING b/COPYING.1
-copy from COPYING
-copy to COPYING.1
---- a/COPYING
-+++ b/COPYING.1
-@@ -6 +6 @@
-- HOWEVER, in order to allow a migration to GPLv3 if that seems like
-+ However, in order to allow a migration to GPLv3 if that seems like
 diff --git a/COPYING b/COPYING
 --- a/COPYING
 +++ b/COPYING
@@ -98,6 +83,14 @@ diff --git a/COPYING b/COPYING
 @@ -12 +12 @@
 -      This file is licensed under the GPL v2, or a later version
 +      This file is licensed under the G.P.L v2, or a later version
+diff --git a/COPYING b/COPYING.1
+copy from COPYING
+copy to COPYING.1
+--- a/COPYING
++++ b/COPYING.1
+@@ -6 +6 @@
+- HOWEVER, in order to allow a migration to GPLv3 if that seems like
++ However, in order to allow a migration to GPLv3 if that seems like
 EOF
 
 test_expect_success \
@@ -115,7 +108,8 @@ test_expect_success \
 # the diff-core.  Unchanged rezrov, although being fed to
 # git-diff-cache as well, should not be mentioned.
 
-GIT_DIFF_OPTS=--unified=0 git-diff-cache -C -p $tree >current
+GIT_DIFF_OPTS=--unified=0 \
+    git-diff-cache -C --find-copies-harder -p $tree >current
 cat >expected <<\EOF
 diff --git a/COPYING b/COPYING.1
 copy from COPYING