3 # Copyright (c) 2005 Junio C Hamano
6 test_description='More rename detection
12 'prepare reference tree' \
13 'cat ../../COPYING >COPYING &&
14 git-update-cache --add COPYING &&
15 tree=$(git-write-tree) &&
20 'sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
21 sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
23 git-update-cache --add --remove COPYING COPYING.?'
25 # tree has COPYING. work tree has COPYING.1 and COPYING.2,
26 # both are slightly edited. So we say you copy-and-edit one,
27 # and rename-and-edit the other.
29 GIT_DIFF_OPTS=--unified=0 git-diff-cache -M -p $tree |
30 sed -e 's/\([0-9][0-9]*\)/#/g' >current &&
32 diff --git a/COPYING b/COPYING.#
39 - HOWEVER, in order to allow a migration to GPLv# if that seems like
40 + However, in order to allow a migration to GPLv# if that seems like
41 diff --git a/COPYING b/COPYING.#
48 - Note that the only valid version of the GPL as far as this project
49 + Note that the only valid version of the G.P.L as far as this project
51 - HOWEVER, in order to allow a migration to GPLv# if that seems like
52 + HOWEVER, in order to allow a migration to G.P.Lv# if that seems like
54 - This file is licensed under the GPL v#, or a later version
55 + This file is licensed under the G.P.L v#, or a later version
59 'validate output from rename/copy detection' \
60 'diff -u current expected'
63 'prepare work tree again' \
64 'mv COPYING.2 COPYING &&
65 git-update-cache --add --remove COPYING COPYING.1 COPYING.2'
67 # tree has COPYING. work tree has COPYING and COPYING.1,
68 # both are slightly edited. So we say you edited one,
69 # and copy-and-edit the other.
71 GIT_DIFF_OPTS=--unified=0 git-diff-cache -C -p $tree |
72 sed -e 's/\([0-9][0-9]*\)/#/g' >current
74 diff --git a/COPYING b/COPYING.#
81 - HOWEVER, in order to allow a migration to GPLv# if that seems like
82 + However, in order to allow a migration to GPLv# if that seems like
83 diff --git a/COPYING b/COPYING
87 - Note that the only valid version of the GPL as far as this project
88 + Note that the only valid version of the G.P.L as far as this project
90 - HOWEVER, in order to allow a migration to GPLv# if that seems like
91 + HOWEVER, in order to allow a migration to G.P.Lv# if that seems like
93 - This file is licensed under the GPL v#, or a later version
94 + This file is licensed under the G.P.L v#, or a later version
98 'validate output from rename/copy detection' \
99 'diff -u current expected'
101 test_expect_success \
102 'prepare work tree once again' \
103 'cat ../../COPYING >COPYING &&
104 git-update-cache --add --remove COPYING COPYING.1'
106 # tree has COPYING. work tree has the same COPYING and COPYING.1,
107 # but COPYING is not edited. We say you copy-and-edit COPYING.1;
108 # this is only possible because -C mode now reports the unmodified
109 # file to the diff-core.
111 GIT_DIFF_OPTS=--unified=0 git-diff-cache -C -p $tree |
112 sed -e 's/\([0-9][0-9]*\)/#/g' >current
114 diff --git a/COPYING b/COPYING.#
121 - HOWEVER, in order to allow a migration to GPLv# if that seems like
122 + However, in order to allow a migration to GPLv# if that seems like
125 test_expect_success \
126 'validate output from rename/copy detection' \
127 'diff -u current expected'