3 # Copyright (c) 2005 Junio C Hamano
6 test_description='Same rename detection as t4003 but testing diff-raw.
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 -M $tree >current
35 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 COPYING COPYING.1
36 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 06c67961bbaed34a127f76d261f4c0bf73eda471 R1234 COPYING COPYING.2
40 'validate output from rename/copy detection (#1)' \
41 'compare_diff_raw current expected'
43 # make sure diff-helper can grok it.
45 GIT_DIFF_OPTS=--unified=0 git-diff-helper <diff-raw >current
47 diff --git a/COPYING b/COPYING.1
53 - HOWEVER, in order to allow a migration to GPLv3 if that seems like
54 + However, in order to allow a migration to GPLv3 if that seems like
55 diff --git a/COPYING b/COPYING.2
61 - Note that the only valid version of the GPL as far as this project
62 + Note that the only valid version of the G.P.L as far as this project
64 - HOWEVER, in order to allow a migration to GPLv3 if that seems like
65 + HOWEVER, in order to allow a migration to G.P.Lv3 if that seems like
67 - This file is licensed under the GPL v2, or a later version
68 + This file is licensed under the G.P.L v2, or a later version
72 'validate output from diff-helper (#1)' \
73 'compare_diff_patch current expected'
75 ################################################################
78 'prepare work tree again' \
79 'mv COPYING.2 COPYING &&
80 git-update-cache --add --remove COPYING COPYING.1 COPYING.2'
82 # tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
83 # both are slightly edited, and unchanged rezrov. We say COPYING.1
84 # is based on COPYING and COPYING is still there, and do not say anything
87 git-diff-cache -C $tree >current
89 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 06c67961bbaed34a127f76d261f4c0bf73eda471 M COPYING
90 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 COPYING COPYING.1
94 'validate output from rename/copy detection (#2)' \
95 'compare_diff_raw current expected'
97 # make sure diff-helper can grok it.
99 GIT_DIFF_OPTS=--unified=0 git-diff-helper <diff-raw >current
101 diff --git a/COPYING b/COPYING
105 - Note that the only valid version of the GPL as far as this project
106 + Note that the only valid version of the G.P.L as far as this project
108 - HOWEVER, in order to allow a migration to GPLv3 if that seems like
109 + HOWEVER, in order to allow a migration to G.P.Lv3 if that seems like
111 - This file is licensed under the GPL v2, or a later version
112 + This file is licensed under the G.P.L v2, or a later version
113 diff --git a/COPYING b/COPYING.1
119 - HOWEVER, in order to allow a migration to GPLv3 if that seems like
120 + However, in order to allow a migration to GPLv3 if that seems like
123 test_expect_success \
124 'validate output from diff-helper (#2)' \
125 'compare_diff_patch current expected'
127 ################################################################
129 # tree has COPYING and rezrov. work tree has the same COPYING and
130 # copy-edited COPYING.1, and unchanged rezrov. We should not say
131 # anything about rezrov nor COPYING, since the revised again diff-raw
132 # nows how to say Copy.
134 test_expect_success \
135 'prepare work tree once again' \
136 'cat ../../COPYING >COPYING &&
137 git-update-cache --add --remove COPYING COPYING.1'
139 git-diff-cache -C $tree >current
141 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 COPYING COPYING.1
144 test_expect_success \
145 'validate output from rename/copy detection (#3)' \
146 'compare_diff_raw current expected'
148 # make sure diff-helper can grok it.
150 GIT_DIFF_OPTS=--unified=0 git-diff-helper <diff-raw >current
152 diff --git a/COPYING b/COPYING.1
158 - HOWEVER, in order to allow a migration to GPLv3 if that seems like
159 + However, in order to allow a migration to GPLv3 if that seems like
162 test_expect_success \
163 'validate output from diff-helper (#3)' \
164 'compare_diff_patch current expected'