@@ -22,20 +22,8 @@ test_expect_success \
22
22
' setup' \
23
23
' mkdir path2 path2/baz &&
24
24
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 &&
39
27
echo Lo >path2/foo &&
40
28
echo Mi >path2/baz/b &&
41
29
find path? \( -type f -o -type l \) -print |
@@ -51,7 +39,7 @@ test_output () {
51
39
test_expect_success \
52
40
' ls-tree plain' \
53
41
' git ls-tree $tree >current &&
54
- make_expected <<\EOF &&
42
+ cat >expected <<\EOF &&
55
43
100644 blob X path0
56
44
120000 blob X path1
57
45
040000 tree X path2
61
49
test_expect_success \
62
50
' ls-tree recursive' \
63
51
' git ls-tree -r $tree >current &&
64
- make_expected <<\EOF &&
52
+ cat >expected <<\EOF &&
65
53
100644 blob X path0
66
54
120000 blob X path1
67
55
100644 blob X path2/baz/b
73
61
test_expect_success \
74
62
' ls-tree recursive with -t' \
75
63
' git ls-tree -r -t $tree >current &&
76
- make_expected <<\EOF &&
64
+ cat >expected <<\EOF &&
77
65
100644 blob X path0
78
66
120000 blob X path1
79
67
040000 tree X path2
87
75
test_expect_success \
88
76
' ls-tree recursive with -d' \
89
77
' git ls-tree -r -d $tree >current &&
90
- make_expected <<\EOF &&
78
+ cat >expected <<\EOF &&
91
79
040000 tree X path2
92
80
040000 tree X path2/baz
93
81
EOF
96
84
test_expect_success \
97
85
' ls-tree filtered with path' \
98
86
' git ls-tree $tree path >current &&
99
- make_expected <<\EOF &&
87
+ cat >expected <<\EOF &&
100
88
EOF
101
89
test_output'
102
90
106
94
test_expect_success \
107
95
' ls-tree filtered with path1 path0' \
108
96
' git ls-tree $tree path1 path0 >current &&
109
- make_expected <<\EOF &&
97
+ cat >expected <<\EOF &&
110
98
100644 blob X path0
111
99
120000 blob X path1
112
100
EOF
115
103
test_expect_success \
116
104
' ls-tree filtered with path0/' \
117
105
' git ls-tree $tree path0/ >current &&
118
- make_expected <<\EOF &&
106
+ cat >expected <<\EOF &&
119
107
EOF
120
108
test_output'
121
109
124
112
test_expect_success \
125
113
' ls-tree filtered with path2' \
126
114
' git ls-tree $tree path2 >current &&
127
- make_expected <<\EOF &&
115
+ cat >expected <<\EOF &&
128
116
040000 tree X path2
129
117
EOF
130
118
test_output'
133
121
test_expect_success \
134
122
' ls-tree filtered with path2/' \
135
123
' git ls-tree $tree path2/ >current &&
136
- make_expected <<\EOF &&
124
+ cat >expected <<\EOF &&
137
125
040000 tree X path2/baz
138
126
120000 blob X path2/bazbo
139
127
100644 blob X path2/foo
@@ -145,30 +133,30 @@ EOF
145
133
test_expect_success \
146
134
' ls-tree filtered with path2/baz' \
147
135
' git ls-tree $tree path2/baz >current &&
148
- make_expected <<\EOF &&
136
+ cat >expected <<\EOF &&
149
137
040000 tree X path2/baz
150
138
EOF
151
139
test_output'
152
140
153
141
test_expect_success \
154
142
' ls-tree filtered with path2/bak' \
155
143
' git ls-tree $tree path2/bak >current &&
156
- make_expected <<\EOF &&
144
+ cat >expected <<\EOF &&
157
145
EOF
158
146
test_output'
159
147
160
148
test_expect_success \
161
149
' ls-tree -t filtered with path2/bak' \
162
150
' git ls-tree -t $tree path2/bak >current &&
163
- make_expected <<\EOF &&
151
+ cat >expected <<\EOF &&
164
152
040000 tree X path2
165
153
EOF
166
154
test_output'
167
155
168
156
test_expect_success \
169
157
' ls-tree with one path a prefix of the other' \
170
158
' git ls-tree $tree path2/baz path2/bazbo >current &&
171
- make_expected <<\EOF &&
159
+ cat >expected <<\EOF &&
172
160
040000 tree X path2/baz
173
161
120000 blob X path2/bazbo
174
162
EOF
0 commit comments