Skip to content

Commit 459b8d2

Browse files
committed
tests: do not borrow from COPYING and README from the real source
These two files have been modified since the tests started using as test input, making the exact object names they expect to be different from what actually happens in the trash repository they use to run tests. Instead, take a snapshot of these two files and keep them in t/diff-lib/ so that we can update the real ones without having to worry about breaking tests. Signed-off-by: Junio C Hamano <[email protected]>
1 parent bb8db1b commit 459b8d2

7 files changed

+433
-26
lines changed

Diff for: t/diff-lib/COPYING

+361
Large diffs are not rendered by default.

Diff for: t/diff-lib/README

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
////////////////////////////////////////////////////////////////
2+
3+
GIT - the stupid content tracker
4+
5+
////////////////////////////////////////////////////////////////
6+
7+
"git" can mean anything, depending on your mood.
8+
9+
- random three-letter combination that is pronounceable, and not
10+
actually used by any common UNIX command. The fact that it is a
11+
mispronunciation of "get" may or may not be relevant.
12+
- stupid. contemptible and despicable. simple. Take your pick from the
13+
dictionary of slang.
14+
- "global information tracker": you're in a good mood, and it actually
15+
works for you. Angels sing, and a light suddenly fills the room.
16+
- "goddamn idiotic truckload of sh*t": when it breaks
17+
18+
Git is a fast, scalable, distributed revision control system with an
19+
unusually rich command set that provides both high-level operations
20+
and full access to internals.
21+
22+
Git is an Open Source project covered by the GNU General Public License.
23+
It was originally written by Linus Torvalds with help of a group of
24+
hackers around the net. It is currently maintained by Junio C Hamano.
25+
26+
Please read the file INSTALL for installation instructions.
27+
See Documentation/tutorial.txt to get started, then see
28+
Documentation/everyday.txt for a useful minimum set of commands,
29+
and "man git-commandname" for documentation of each command.
30+
CVS users may also want to read Documentation/cvs-migration.txt.
31+
32+
Many Git online resources are accessible from http://git.or.cz/
33+
including full documentation and Git related tools.
34+
35+
The user discussion and development of Git take place on the Git
36+
mailing list -- everyone is welcome to post bug reports, feature
37+
requests, comments and patches to [email protected]. To subscribe
38+
to the list, send an email with just "subscribe git" in the body to
39+
[email protected]. The mailing list archives are available at
40+
http://marc.theaimsgroup.com/?l=git and other archival sites.
41+
42+
The messages titled "A note from the maintainer", "What's in
43+
git.git (stable)" and "What's cooking in git.git (topics)" and
44+
the discussion following them on the mailing list give a good
45+
reference for project status, development direction and
46+
remaining tasks.

Diff for: t/t4003-diff-rename-1.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_description='More rename detection
1111

1212
test_expect_success \
1313
'prepare reference tree' \
14-
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
14+
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
1515
echo frotz >rezrov &&
1616
git update-index --add COPYING rezrov &&
1717
tree=$(git write-tree) &&
@@ -99,7 +99,7 @@ test_expect_success \
9999

100100
test_expect_success \
101101
'prepare work tree once again' \
102-
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
102+
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
103103
git update-index --add --remove COPYING COPYING.1'
104104

105105
# tree has COPYING and rezrov. work tree has COPYING and COPYING.1,

Diff for: t/t4005-diff-rename-2.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_description='Same rename detection as t4003 but testing diff-raw.
1111

1212
test_expect_success \
1313
'prepare reference tree' \
14-
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
14+
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
1515
echo frotz >rezrov &&
1616
git update-index --add COPYING rezrov &&
1717
tree=$(git write-tree) &&
@@ -71,7 +71,7 @@ test_expect_success \
7171

7272
test_expect_success \
7373
'prepare work tree once again' \
74-
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
74+
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
7575
git update-index --add --remove COPYING COPYING.1'
7676

7777
git diff-index -C --find-copies-harder $tree >current

Diff for: t/t4007-rename-3.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_description='Rename interaction with pathspec.
1111

1212
test_expect_success 'prepare reference tree' '
1313
mkdir path0 path1 &&
14-
cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
14+
cp "$TEST_DIRECTORY"/diff-lib/COPYING path0/COPYING &&
1515
git update-index --add path0/COPYING &&
1616
tree=$(git write-tree) &&
1717
echo $tree

Diff for: t/t4008-diff-break-rewrite.sh

+19-19
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Further, with -B and -M together, these should turn into two renames.
2626

2727
test_expect_success \
2828
setup \
29-
'cat "$TEST_DIRECTORY"/../README >file0 &&
30-
cat "$TEST_DIRECTORY"/../COPYING >file1 &&
29+
'cat "$TEST_DIRECTORY"/diff-lib/README >file0 &&
30+
cat "$TEST_DIRECTORY"/diff-lib/COPYING >file1 &&
3131
git update-index --add file0 file1 &&
3232
tree=$(git write-tree) &&
3333
echo "$tree"'
@@ -43,8 +43,8 @@ test_expect_success \
4343
'git diff-index -B --cached "$tree" >current'
4444

4545
cat >expected <<\EOF
46-
:100644 000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 0000000000000000000000000000000000000000 D file0
47-
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 11e331465a89c394dc25c780de230043750c1ec8 M100 file1
46+
:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D file0
47+
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100 file1
4848
EOF
4949

5050
test_expect_success \
@@ -56,7 +56,7 @@ test_expect_success \
5656
'git diff-index -B -M "$tree" >current'
5757

5858
cat >expected <<\EOF
59-
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 08bb2fb671deff4c03a4d4a0a1315dff98d5732c R100 file0 file1
59+
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec R100 file0 file1
6060
EOF
6161

6262
test_expect_success \
@@ -78,8 +78,8 @@ test_expect_success \
7878
'git diff-index -B "$tree" >current'
7979

8080
cat >expected <<\EOF
81-
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 6ff87c4664981e4397625791c8ea3bbb5f2279a3 M100 file0
82-
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100 file1
81+
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 6ff87c4664981e4397625791c8ea3bbb5f2279a3 M100 file0
82+
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100 file1
8383
EOF
8484

8585
test_expect_success \
@@ -92,7 +92,7 @@ test_expect_success \
9292

9393
cat >expected <<\EOF
9494
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 6ff87c4664981e4397625791c8ea3bbb5f2279a3 R100 file1 file0
95-
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 R100 file0 file1
95+
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 R100 file0 file1
9696
EOF
9797

9898
test_expect_success \
@@ -110,8 +110,8 @@ test_expect_success \
110110
'git diff-index -B "$tree" >current'
111111

112112
cat >expected <<\EOF
113-
:100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0
114-
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100 file1
113+
:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T file0
114+
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100 file1
115115
EOF
116116

117117
test_expect_success \
@@ -125,8 +125,8 @@ test_expect_success \
125125
# file0 changed from regular to symlink. file1 is very close to the preimage of file0.
126126
# the change does not make file0 disappear, so file1 is denoted as a copy of file0
127127
cat >expected <<\EOF
128-
:100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0
129-
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 C file0 file1
128+
:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T file0
129+
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 C file0 file1
130130
EOF
131131

132132
test_expect_success \
@@ -140,8 +140,8 @@ test_expect_success \
140140
# This should not mistake file0 as the copy source of new file1
141141
# due to type differences.
142142
cat >expected <<\EOF
143-
:100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0
144-
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M file1
143+
:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T file0
144+
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M file1
145145
EOF
146146

147147
test_expect_success \
@@ -163,9 +163,9 @@ test_expect_success \
163163
'git diff-index -B "$tree" >current'
164164

165165
cat >expected <<\EOF
166-
:100644 000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 0000000000000000000000000000000000000000 D file0
167-
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 08bb2fb671deff4c03a4d4a0a1315dff98d5732c M100 file1
168-
:000000 100644 0000000000000000000000000000000000000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 A file2
166+
:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D file0
167+
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100 file1
168+
:000000 100644 0000000000000000000000000000000000000000 69a939f651686f56322566e2fd76715947a24162 A file2
169169
EOF
170170

171171
test_expect_success \
@@ -177,8 +177,8 @@ test_expect_success \
177177
'git diff-index -B -C "$tree" >current'
178178

179179
cat >expected <<\EOF
180-
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 08bb2fb671deff4c03a4d4a0a1315dff98d5732c C095 file0 file1
181-
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 59f832e5c8b3f7e486be15ad0cd3e95ba9af8998 R095 file0 file2
180+
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec C095 file0 file1
181+
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 69a939f651686f56322566e2fd76715947a24162 R095 file0 file2
182182
EOF
183183

184184
test_expect_success \

Diff for: t/t4009-diff-rename-4.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.
1111

1212
test_expect_success \
1313
'prepare reference tree' \
14-
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
14+
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
1515
echo frotz >rezrov &&
1616
git update-index --add COPYING rezrov &&
1717
tree=$(git write-tree) &&
@@ -78,7 +78,7 @@ test_expect_success \
7878

7979
test_expect_success \
8080
'prepare work tree once again' \
81-
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
81+
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
8282
git update-index --add --remove COPYING COPYING.1'
8383

8484
git diff-index -z -C --find-copies-harder $tree >current

0 commit comments

Comments
 (0)