3 # Copyright (c) 2005 Junio C Hamano
6 test_description='More rename detection
12 'prepare reference tree' \
13 'cat ../../COPYING >COPYING &&
15 git-update-cache --add COPYING rezrov &&
16 tree=$(git-write-tree) &&
21 'sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
22 sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
24 git-update-cache --add --remove COPYING COPYING.?'
26 # tree has COPYING and rezrov. work tree has COPYING.1 and COPYING.2,
27 # both are slightly edited, and unchanged rezrov. So we say you
28 # copy-and-edit one, and rename-and-edit the other. We do not say
29 # anything about rezrov.
31 GIT_DIFF_OPTS=--unified=0 git-diff-cache -M -p $tree |
32 sed -e 's/\([0-9][0-9]*\)/#/g' >current &&
34 diff --git a/COPYING b/COPYING.#
41 - HOWEVER, in order to allow a migration to GPLv# if that seems like
42 + However, in order to allow a migration to GPLv# if that seems like
43 diff --git a/COPYING b/COPYING.#
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 GPLv# if that seems like
54 + HOWEVER, in order to allow a migration to G.P.Lv# if that seems like
56 - This file is licensed under the GPL v#, or a later version
57 + This file is licensed under the G.P.L v#, or a later version
61 'validate output from rename/copy detection' \
62 'diff -u current expected'
65 'prepare work tree again' \
66 'mv COPYING.2 COPYING &&
67 git-update-cache --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-cache -C -p $tree |
75 sed -e 's/\([0-9][0-9]*\)/#/g' >current
77 diff --git a/COPYING b/COPYING.#
84 - HOWEVER, in order to allow a migration to GPLv# if that seems like
85 + However, in order to allow a migration to GPLv# if that seems like
86 diff --git a/COPYING b/COPYING
90 - Note that the only valid version of the GPL as far as this project
91 + Note that the only valid version of the G.P.L as far as this project
93 - HOWEVER, in order to allow a migration to GPLv# if that seems like
94 + HOWEVER, in order to allow a migration to G.P.Lv# if that seems like
96 - This file is licensed under the GPL v#, or a later version
97 + This file is licensed under the G.P.L v#, or a later version
100 test_expect_success \
101 'validate output from rename/copy detection' \
102 'diff -u current expected'
104 test_expect_success \
105 'prepare work tree once again' \
106 'cat ../../COPYING >COPYING &&
107 git-update-cache --add --remove COPYING COPYING.1'
109 # tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
110 # but COPYING is not edited. We say you copy-and-edit COPYING.1; this
111 # is only possible because -C mode now reports the unmodified file to
112 # the diff-core. Unchanged rezrov, although being fed to
113 # git-diff-cache as well, should not be mentioned.
115 GIT_DIFF_OPTS=--unified=0 git-diff-cache -C -p $tree |
116 sed -e 's/\([0-9][0-9]*\)/#/g' >current
118 diff --git a/COPYING b/COPYING.#
125 - HOWEVER, in order to allow a migration to GPLv# if that seems like
126 + However, in order to allow a migration to GPLv# if that seems like
129 test_expect_success \
130 'validate output from rename/copy detection' \
131 'diff -u current expected'