3 # Copyright (c) 2005 Junio C Hamano
6 test_description
='Same rename detection as t4003 but testing diff-raw -z.
10 . ..
/diff-lib.sh
;# test-lib chdir's into trash
13 'prepare reference tree' \
14 'cat ../../COPYING >COPYING &&
16 git-update-cache --add COPYING rezrov &&
17 tree=$(git-write-tree) &&
22 'sed -e 's
/HOWEVER
/However
/' <COPYING >COPYING.1 &&
23 sed -e 's
/GPL
/G.P.L
/g
' <COPYING >COPYING.2 &&
25 git-update-cache --add --remove COPYING COPYING.?'
27 # tree has COPYING and rezrov. work tree has COPYING.1 and COPYING.2,
28 # both are slightly edited, and unchanged rezrov. We say COPYING.1
29 # and COPYING.2 are based on COPYING, and do not say anything about
32 git-diff-cache
-z -M $tree >current
35 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3
0603b3238a076dc6c8022aedc6648fa523a17178 C1234
38 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3
06c67961bbaed34a127f76d261f4c0bf73eda471 R1234
44 'validate output from rename/copy detection (#1)' \
45 'compare_diff_raw_z current expected'
47 # make sure diff-helper can grok it.
49 GIT_DIFF_OPTS
=--unified=0 git-diff-helper
-z <diff-raw
>current
51 diff --git a
/COPYING b
/COPYING
.1
57 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
58 + However
, in order to allow a migration to GPLv3
if that seems like
59 diff --git a
/COPYING b
/COPYING
.2
65 - Note that the only valid version of the GPL as far as this project
66 + Note that the only valid version of the G.P.L as far as this project
68 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
69 + HOWEVER
, in order to allow a migration to G.P.Lv3
if that seems like
71 - This
file is licensed under the GPL v2
, or a later version
72 + This
file is licensed under the G.P.L v2
, or a later version
76 'validate output from diff-helper (#1)' \
77 'compare_diff_patch current expected'
79 ################################################################
82 'prepare work tree again' \
83 'mv COPYING.2 COPYING &&
84 git-update-cache --add --remove COPYING COPYING.1 COPYING.2'
86 # tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
87 # both are slightly edited, and unchanged rezrov. We say COPYING.1
88 # is based on COPYING and COPYING is still there, and do not say anything
91 git-diff-cache
-z -C $tree >current
93 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3
06c67961bbaed34a127f76d261f4c0bf73eda471 M
95 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3
0603b3238a076dc6c8022aedc6648fa523a17178 C1234
100 test_expect_success \
101 'validate output from rename/copy detection (#2)' \
102 'compare_diff_raw_z current expected'
104 # make sure diff-helper can grok it.
106 GIT_DIFF_OPTS
=--unified=0 git-diff-helper
-z <diff-raw
>current
108 diff --git a
/COPYING b
/COPYING
112 - Note that the only valid version of the GPL as far as this project
113 + Note that the only valid version of the G.P.L as far as this project
115 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
116 + HOWEVER
, in order to allow a migration to G.P.Lv3
if that seems like
118 - This
file is licensed under the GPL v2
, or a later version
119 + This
file is licensed under the G.P.L v2
, or a later version
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 diff-helper (#2)' \
132 'compare_diff_patch current expected'
134 ################################################################
136 # tree has COPYING and rezrov. work tree has the same COPYING and
137 # copy-edited COPYING.1, and unchanged rezrov. We should not say
138 # anything about rezrov nor COPYING, since the revised again diff-raw
139 # nows how to say Copy.
141 test_expect_success \
142 'prepare work tree once again' \
143 'cat ../../COPYING >COPYING &&
144 git-update-cache --add --remove COPYING COPYING.1'
146 git-diff-cache
-z -C $tree >current
148 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3
0603b3238a076dc6c8022aedc6648fa523a17178 C1234
153 test_expect_success \
154 'validate output from rename/copy detection (#3)' \
155 'compare_diff_raw_z current expected'
157 # make sure diff-helper can grok it.
159 GIT_DIFF_OPTS
=--unified=0 git-diff-helper
-z <diff-raw
>current
161 diff --git a
/COPYING b
/COPYING
.1
167 - HOWEVER
, in order to allow a migration to GPLv3
if that seems like
168 + However
, in order to allow a migration to GPLv3
if that seems like
171 test_expect_success \
172 'validate output from diff-helper (#3)' \
173 'compare_diff_patch current expected'