Skip to content

Commit e40db07

Browse files
j6tgitster
authored andcommitted
t3100: use test_ln_s_add to remove SYMLINKS prerequisite
This undoes the special casing introduced in this test by 704a314 (Use prerequisite tags to skip tests that depend on symbolic links, 2009-03-04). Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bba5604 commit e40db07

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

t/t3100-ls-tree-restrict.sh

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,8 @@ test_expect_success \
2222
'setup' \
2323
'mkdir path2 path2/baz &&
2424
echo Hi >path0 &&
25-
if test_have_prereq SYMLINKS
26-
then
27-
ln -s path0 path1 &&
28-
ln -s ../path1 path2/bazbo
29-
make_expected () {
30-
cat >expected
31-
}
32-
else
33-
printf path0 > path1 &&
34-
printf ../path1 > path2/bazbo
35-
make_expected () {
36-
sed -e "s/120000 /100644 /" >expected
37-
}
38-
fi &&
25+
test_ln_s_add path0 path1 &&
26+
test_ln_s_add ../path1 path2/bazbo &&
3927
echo Lo >path2/foo &&
4028
echo Mi >path2/baz/b &&
4129
find path? \( -type f -o -type l \) -print |
@@ -51,7 +39,7 @@ test_output () {
5139
test_expect_success \
5240
'ls-tree plain' \
5341
'git ls-tree $tree >current &&
54-
make_expected <<\EOF &&
42+
cat >expected <<\EOF &&
5543
100644 blob X path0
5644
120000 blob X path1
5745
040000 tree X path2
@@ -61,7 +49,7 @@ EOF
6149
test_expect_success \
6250
'ls-tree recursive' \
6351
'git ls-tree -r $tree >current &&
64-
make_expected <<\EOF &&
52+
cat >expected <<\EOF &&
6553
100644 blob X path0
6654
120000 blob X path1
6755
100644 blob X path2/baz/b
@@ -73,7 +61,7 @@ EOF
7361
test_expect_success \
7462
'ls-tree recursive with -t' \
7563
'git ls-tree -r -t $tree >current &&
76-
make_expected <<\EOF &&
64+
cat >expected <<\EOF &&
7765
100644 blob X path0
7866
120000 blob X path1
7967
040000 tree X path2
@@ -87,7 +75,7 @@ EOF
8775
test_expect_success \
8876
'ls-tree recursive with -d' \
8977
'git ls-tree -r -d $tree >current &&
90-
make_expected <<\EOF &&
78+
cat >expected <<\EOF &&
9179
040000 tree X path2
9280
040000 tree X path2/baz
9381
EOF
@@ -96,7 +84,7 @@ EOF
9684
test_expect_success \
9785
'ls-tree filtered with path' \
9886
'git ls-tree $tree path >current &&
99-
make_expected <<\EOF &&
87+
cat >expected <<\EOF &&
10088
EOF
10189
test_output'
10290

@@ -106,7 +94,7 @@ EOF
10694
test_expect_success \
10795
'ls-tree filtered with path1 path0' \
10896
'git ls-tree $tree path1 path0 >current &&
109-
make_expected <<\EOF &&
97+
cat >expected <<\EOF &&
11098
100644 blob X path0
11199
120000 blob X path1
112100
EOF
@@ -115,7 +103,7 @@ EOF
115103
test_expect_success \
116104
'ls-tree filtered with path0/' \
117105
'git ls-tree $tree path0/ >current &&
118-
make_expected <<\EOF &&
106+
cat >expected <<\EOF &&
119107
EOF
120108
test_output'
121109

@@ -124,7 +112,7 @@ EOF
124112
test_expect_success \
125113
'ls-tree filtered with path2' \
126114
'git ls-tree $tree path2 >current &&
127-
make_expected <<\EOF &&
115+
cat >expected <<\EOF &&
128116
040000 tree X path2
129117
EOF
130118
test_output'
@@ -133,7 +121,7 @@ EOF
133121
test_expect_success \
134122
'ls-tree filtered with path2/' \
135123
'git ls-tree $tree path2/ >current &&
136-
make_expected <<\EOF &&
124+
cat >expected <<\EOF &&
137125
040000 tree X path2/baz
138126
120000 blob X path2/bazbo
139127
100644 blob X path2/foo
@@ -145,30 +133,30 @@ EOF
145133
test_expect_success \
146134
'ls-tree filtered with path2/baz' \
147135
'git ls-tree $tree path2/baz >current &&
148-
make_expected <<\EOF &&
136+
cat >expected <<\EOF &&
149137
040000 tree X path2/baz
150138
EOF
151139
test_output'
152140

153141
test_expect_success \
154142
'ls-tree filtered with path2/bak' \
155143
'git ls-tree $tree path2/bak >current &&
156-
make_expected <<\EOF &&
144+
cat >expected <<\EOF &&
157145
EOF
158146
test_output'
159147

160148
test_expect_success \
161149
'ls-tree -t filtered with path2/bak' \
162150
'git ls-tree -t $tree path2/bak >current &&
163-
make_expected <<\EOF &&
151+
cat >expected <<\EOF &&
164152
040000 tree X path2
165153
EOF
166154
test_output'
167155

168156
test_expect_success \
169157
'ls-tree with one path a prefix of the other' \
170158
'git ls-tree $tree path2/baz path2/bazbo >current &&
171-
make_expected <<\EOF &&
159+
cat >expected <<\EOF &&
172160
040000 tree X path2/baz
173161
120000 blob X path2/bazbo
174162
EOF

0 commit comments

Comments
 (0)