3 # Copyright (c) 2005 Junio C Hamano
6 test_description
='More rename detection
10 TEST_PASSES_SANITIZE_LEAK
=true
12 .
"$TEST_DIRECTORY"/lib-diff.sh
;# test-lib chdir's into trash
14 test_expect_success
'prepare reference tree' '
15 COPYING_test_data >COPYING &&
17 git update-index --add COPYING rezrov &&
18 tree=$(git write-tree) &&
22 test_expect_success
'prepare work tree' '
23 sed -e 's
/HOWEVER
/However
/' <COPYING >COPYING.1 &&
24 sed -e 's
/GPL
/G.P.L
/g
' <COPYING >COPYING.2 &&
26 git update-index --add --remove COPYING COPYING.?
29 # tree has COPYING and rezrov. work tree has COPYING.1 and COPYING.2,
30 # both are slightly edited, and unchanged rezrov. So we say you
31 # copy-and-edit one, and rename-and-edit the other. We do not say
32 # anything about rezrov.
34 GIT_DIFF_OPTS
=--unified=0 git diff-index
-C -p $tree >current
36 diff --git a
/COPYING b
/COPYING
.1
42 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
43 + However
, in order to allow a migration to GPLv3
if that seems like
44 diff --git a
/COPYING b
/COPYING
.2
50 - Note that the only valid version of the GPL as far as this project
51 + Note that the only valid version of the G.P.L as far as this project
53 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
54 + HOWEVER
, in order to allow a migration to G.P.Lv3
if that seems like
56 - This
file is licensed under the GPL v2
, or a later version
57 + This
file is licensed under the G.P.L v2
, or a later version
60 test_expect_success
'validate output from rename/copy detection (#1)' '
61 compare_diff_patch current expected
64 test_expect_success
'prepare work tree again' '
65 mv COPYING.2 COPYING &&
66 git update-index --add --remove COPYING COPYING.1 COPYING.2
69 # tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
70 # both are slightly edited, and unchanged rezrov. So we say you
71 # edited one, and copy-and-edit the other. We do not say
72 # anything about rezrov.
74 GIT_DIFF_OPTS
=--unified=0 git diff-index
-C -p $tree >current
76 diff --git a
/COPYING b
/COPYING
80 - Note that the only valid version of the GPL as far as this project
81 + Note that the only valid version of the G.P.L as far as this project
83 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
84 + HOWEVER
, in order to allow a migration to G.P.Lv3
if that seems like
86 - This
file is licensed under the GPL v2
, or a later version
87 + This
file is licensed under the G.P.L v2
, or a later version
88 diff --git a
/COPYING b
/COPYING
.1
94 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
95 + However
, in order to allow a migration to GPLv3
if that seems like
98 test_expect_success
'validate output from rename/copy detection (#2)' '
99 compare_diff_patch current expected
102 test_expect_success
'prepare work tree once again' '
103 COPYING_test_data >COPYING &&
104 git update-index --add --remove COPYING COPYING.1
107 # tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
108 # but COPYING is not edited. We say you copy-and-edit COPYING.1; this
109 # is only possible because -C mode now reports the unmodified file to
110 # the diff-core. Unchanged rezrov, although being fed to
111 # git diff-index as well, should not be mentioned.
113 GIT_DIFF_OPTS
=--unified=0 \
114 git diff-index
-C --find-copies-harder -p $tree >current
116 diff --git a
/COPYING b
/COPYING
.1
122 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
123 + However
, in order to allow a migration to GPLv3
if that seems like
126 test_expect_success
'validate output from rename/copy detection (#3)' '
127 compare_diff_patch current expected