3 # Copyright (c) 2005 Junio C Hamano
6 test_description
='More rename detection
11 compare_diff_patch
() {
12 # When heuristics are improved, the score numbers would change.
13 # Ignore them while comparing.
14 sed -e '/^similarity index [0-9]*%$/d' <"$1" >.tmp-1
15 sed -e '/^similarity index [0-9]*%$/d' <"$2" >.tmp-2
16 diff -u .tmp-1 .tmp-2
&& rm -f .tmp-1 .tmp-2
20 'prepare reference tree' \
21 'cat ../../COPYING >COPYING &&
23 git-update-cache --add COPYING rezrov &&
24 tree=$(git-write-tree) &&
29 'sed -e 's
/HOWEVER
/However
/' <COPYING >COPYING.1 &&
30 sed -e 's
/GPL
/G.P.L
/g
' <COPYING >COPYING.2 &&
32 git-update-cache --add --remove COPYING COPYING.?'
34 # tree has COPYING and rezrov. work tree has COPYING.1 and COPYING.2,
35 # both are slightly edited, and unchanged rezrov. So we say you
36 # copy-and-edit one, and rename-and-edit the other. We do not say
37 # anything about rezrov.
39 GIT_DIFF_OPTS
=--unified=0 git-diff-cache
-M -p $tree >current
41 diff --git a
/COPYING b
/COPYING
.1
47 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
48 + However
, in order to allow a migration to GPLv3
if that seems like
49 diff --git a
/COPYING b
/COPYING
.2
55 - Note that the only valid version of the GPL as far as this project
56 + Note that the only valid version of the G.P.L as far as this project
58 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
59 + HOWEVER
, in order to allow a migration to G.P.Lv3
if that seems like
61 - This
file is licensed under the GPL v2
, or a later version
62 + This
file is licensed under the G.P.L v2
, or a later version
66 'validate output from rename/copy detection (#1)' \
67 'compare_diff_patch current expected'
70 'prepare work tree again' \
71 'mv COPYING.2 COPYING &&
72 git-update-cache --add --remove COPYING COPYING.1 COPYING.2'
74 # tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
75 # both are slightly edited, and unchanged rezrov. So we say you
76 # edited one, and copy-and-edit the other. We do not say
77 # anything about rezrov.
79 GIT_DIFF_OPTS
=--unified=0 git-diff-cache
-C -p $tree >current
81 diff --git a
/COPYING b
/COPYING
85 - Note that the only valid version of the GPL as far as this project
86 + Note that the only valid version of the G.P.L as far as this project
88 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
89 + HOWEVER
, in order to allow a migration to G.P.Lv3
if that seems like
91 - This
file is licensed under the GPL v2
, or a later version
92 + This
file is licensed under the G.P.L v2
, or a later version
93 diff --git a
/COPYING b
/COPYING
.1
99 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
100 + However
, in order to allow a migration to GPLv3
if that seems like
103 test_expect_success \
104 'validate output from rename/copy detection (#2)' \
105 'compare_diff_patch current expected'
107 test_expect_success \
108 'prepare work tree once again' \
109 'cat ../../COPYING >COPYING &&
110 git-update-cache --add --remove COPYING COPYING.1'
112 # tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
113 # but COPYING is not edited. We say you copy-and-edit COPYING.1; this
114 # is only possible because -C mode now reports the unmodified file to
115 # the diff-core. Unchanged rezrov, although being fed to
116 # git-diff-cache as well, should not be mentioned.
118 GIT_DIFF_OPTS
=--unified=0 git-diff-cache
-C -p $tree >current
120 diff --git a
/COPYING b
/COPYING
.1
126 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
127 + However
, in order to allow a migration to GPLv3
if that seems like
130 test_expect_success \
131 'validate output from rename/copy detection (#3)' \
132 'compare_diff_patch current expected'