t1002-read-tree-m-u-2way: modernize test format

Some tests are still using the older four space indent format. Update these to use tabs. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John Cai committed May 18, 2023 at 20:03 UTC a10bb2ded5e0c7cdbf047a22c3346215d215844c
1 file changed +293 -296
t/t1002-read-tree-m-u-2way.sh
+293 -296
@@ -37,315 +37,312 @@ check_cache_at () {
37 esac
38 }
39
40 -test_expect_success \
41 - setup \
42 - 'echo frotz >frotz &&
43 - echo nitfol >nitfol &&
44 - echo bozbar >bozbar &&
45 - echo rezrov >rezrov &&
46 - git update-index --add nitfol bozbar rezrov &&
47 - treeH=$(git write-tree) &&
48 - echo treeH $treeH &&
49 - git ls-tree $treeH &&
50 -
51 - echo gnusto >bozbar &&
52 - git update-index --add frotz bozbar --force-remove rezrov &&
53 - git ls-files --stage >M.out &&
54 - treeM=$(git write-tree) &&
55 - echo treeM $treeM &&
56 - git ls-tree $treeM &&
57 - cp bozbar bozbar.M &&
58 - cp frotz frotz.M &&
59 - cp nitfol nitfol.M &&
60 - git diff-tree $treeH $treeM'
61 -
62 -test_expect_success \
63 - '1, 2, 3 - no carry forward' \
64 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
65 - read_tree_u_must_succeed --reset -u $treeH &&
66 - read_tree_u_must_succeed -m -u $treeH $treeM &&
67 - git ls-files --stage >1-3.out &&
68 - cmp M.out 1-3.out &&
69 - test_cmp bozbar.M bozbar &&
70 - test_cmp frotz.M frotz &&
71 - test_cmp nitfol.M nitfol &&
72 - check_cache_at bozbar clean &&
73 - check_cache_at frotz clean &&
74 - check_cache_at nitfol clean'
75 -
76 -test_expect_success \
77 - '4 - carry forward local addition.' \
78 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
79 - read_tree_u_must_succeed --reset -u $treeH &&
80 - echo "+100644 X 0 yomin" >expected &&
81 - echo yomin >yomin &&
82 - git update-index --add yomin &&
83 - read_tree_u_must_succeed -m -u $treeH $treeM &&
84 - git ls-files --stage >4.out &&
85 - test_might_fail git diff -U0 --no-index M.out 4.out >4diff.out &&
86 - compare_change 4diff.out expected &&
87 - check_cache_at yomin clean &&
88 - test_cmp bozbar.M bozbar &&
89 - test_cmp frotz.M frotz &&
90 - test_cmp nitfol.M nitfol &&
91 - echo yomin >yomin1 &&
92 - diff yomin yomin1 &&
93 - rm -f yomin1'
94 -
95 -test_expect_success \
96 - '5 - carry forward local addition.' \
97 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
98 - read_tree_u_must_succeed --reset -u $treeH &&
99 - read_tree_u_must_succeed -m -u $treeH &&
100 - echo yomin >yomin &&
101 - git update-index --add yomin &&
102 - echo yomin yomin >yomin &&
103 - read_tree_u_must_succeed -m -u $treeH $treeM &&
104 - git ls-files --stage >5.out &&
105 - test_might_fail git diff -U0 --no-index M.out 5.out >5diff.out &&
106 - compare_change 5diff.out expected &&
107 - check_cache_at yomin dirty &&
108 - test_cmp bozbar.M bozbar &&
109 - test_cmp frotz.M frotz &&
110 - test_cmp nitfol.M nitfol &&
111 - : dirty index should have prevented -u from checking it out. &&
112 - echo yomin yomin >yomin1 &&
113 - diff yomin yomin1 &&
114 - rm -f yomin1'
115 -
116 -test_expect_success \
117 - '6 - local addition already has the same.' \
118 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
119 - read_tree_u_must_succeed --reset -u $treeH &&
120 - echo frotz >frotz &&
121 - git update-index --add frotz &&
122 - read_tree_u_must_succeed -m -u $treeH $treeM &&
123 - git ls-files --stage >6.out &&
124 - test_cmp M.out 6.out &&
125 - check_cache_at frotz clean &&
126 - test_cmp bozbar.M bozbar &&
127 - test_cmp frotz.M frotz &&
128 - test_cmp nitfol.M nitfol &&
129 - echo frotz >frotz1 &&
130 - diff frotz frotz1 &&
131 - rm -f frotz1'
132 -
133 -test_expect_success \
134 - '7 - local addition already has the same.' \
135 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
136 - read_tree_u_must_succeed --reset -u $treeH &&
137 - echo frotz >frotz &&
138 - git update-index --add frotz &&
139 - echo frotz frotz >frotz &&
140 - read_tree_u_must_succeed -m -u $treeH $treeM &&
141 - git ls-files --stage >7.out &&
142 - test_cmp M.out 7.out &&
143 - check_cache_at frotz dirty &&
144 - test_cmp bozbar.M bozbar &&
145 - test_cmp nitfol.M nitfol &&
146 - : dirty index should have prevented -u from checking it out. &&
147 - echo frotz frotz >frotz1 &&
148 - diff frotz frotz1 &&
149 - rm -f frotz1'
150 -
151 -test_expect_success \
152 - '8 - conflicting addition.' \
153 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
154 - read_tree_u_must_succeed --reset -u $treeH &&
155 - echo frotz frotz >frotz &&
156 - git update-index --add frotz &&
157 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
158 -
159 -test_expect_success \
160 - '9 - conflicting addition.' \
161 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
162 - read_tree_u_must_succeed --reset -u $treeH &&
163 - echo frotz frotz >frotz &&
164 - git update-index --add frotz &&
165 - echo frotz >frotz &&
166 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
167 -
168 -test_expect_success \
169 - '10 - path removed.' \
170 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
171 - read_tree_u_must_succeed --reset -u $treeH &&
172 - echo rezrov >rezrov &&
173 - git update-index --add rezrov &&
174 - read_tree_u_must_succeed -m -u $treeH $treeM &&
175 - git ls-files --stage >10.out &&
176 - cmp M.out 10.out &&
177 - test_cmp bozbar.M bozbar &&
178 - test_cmp frotz.M frotz &&
179 - test_cmp nitfol.M nitfol
40 +test_expect_success setup '
41 + echo frotz >frotz &&
42 + echo nitfol >nitfol &&
43 + echo bozbar >bozbar &&
44 + echo rezrov >rezrov &&
45 + git update-index --add nitfol bozbar rezrov &&
46 + treeH=$(git write-tree) &&
47 + echo treeH $treeH &&
48 + git ls-tree $treeH &&
49 +
50 + echo gnusto >bozbar &&
51 + git update-index --add frotz bozbar --force-remove rezrov &&
52 + git ls-files --stage >M.out &&
53 + treeM=$(git write-tree) &&
54 + echo treeM $treeM &&
55 + git ls-tree $treeM &&
56 + cp bozbar bozbar.M &&
57 + cp frotz frotz.M &&
58 + cp nitfol nitfol.M &&
59 + git diff-tree $treeH $treeM
60 '
61
182 -test_expect_success \
183 - '11 - dirty path removed.' \
184 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
185 - read_tree_u_must_succeed --reset -u $treeH &&
186 - echo rezrov >rezrov &&
187 - git update-index --add rezrov &&
188 - echo rezrov rezrov >rezrov &&
189 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
190 -
191 -test_expect_success \
192 - '12 - unmatching local changes being removed.' \
193 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
194 - read_tree_u_must_succeed --reset -u $treeH &&
195 - echo rezrov rezrov >rezrov &&
196 - git update-index --add rezrov &&
197 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
198 -
199 -test_expect_success \
200 - '13 - unmatching local changes being removed.' \
201 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
202 - read_tree_u_must_succeed --reset -u $treeH &&
203 - echo rezrov rezrov >rezrov &&
204 - git update-index --add rezrov &&
205 - echo rezrov >rezrov &&
206 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
62 +test_expect_success '1, 2, 3 - no carry forward' '
63 + rm -f .git/index nitfol bozbar rezrov frotz &&
64 + read_tree_u_must_succeed --reset -u $treeH &&
65 + read_tree_u_must_succeed -m -u $treeH $treeM &&
66 + git ls-files --stage >1-3.out &&
67 + cmp M.out 1-3.out &&
68 + test_cmp bozbar.M bozbar &&
69 + test_cmp frotz.M frotz &&
70 + test_cmp nitfol.M nitfol &&
71 + check_cache_at bozbar clean &&
72 + check_cache_at frotz clean &&
73 + check_cache_at nitfol clean
74 +'
75 +
76 +test_expect_success '4 - carry forward local addition.' '
77 + rm -f .git/index nitfol bozbar rezrov frotz &&
78 + read_tree_u_must_succeed --reset -u $treeH &&
79 + echo "+100644 X 0 yomin" >expected &&
80 + echo yomin >yomin &&
81 + git update-index --add yomin &&
82 + read_tree_u_must_succeed -m -u $treeH $treeM &&
83 + git ls-files --stage >4.out &&
84 + test_might_fail git diff -U0 --no-index M.out 4.out >4diff.out &&
85 + compare_change 4diff.out expected &&
86 + check_cache_at yomin clean &&
87 + test_cmp bozbar.M bozbar &&
88 + test_cmp frotz.M frotz &&
89 + test_cmp nitfol.M nitfol &&
90 + echo yomin >yomin1 &&
91 + diff yomin yomin1 &&
92 + rm -f yomin1
93 +'
94 +
95 +test_expect_success '5 - carry forward local addition.' '
96 + rm -f .git/index nitfol bozbar rezrov frotz &&
97 + read_tree_u_must_succeed --reset -u $treeH &&
98 + read_tree_u_must_succeed -m -u $treeH &&
99 + echo yomin >yomin &&
100 + git update-index --add yomin &&
101 + echo yomin yomin >yomin &&
102 + read_tree_u_must_succeed -m -u $treeH $treeM &&
103 + git ls-files --stage >5.out &&
104 + test_might_fail git diff -U0 --no-index M.out 5.out >5diff.out &&
105 + compare_change 5diff.out expected &&
106 + check_cache_at yomin dirty &&
107 + test_cmp bozbar.M bozbar &&
108 + test_cmp frotz.M frotz &&
109 + test_cmp nitfol.M nitfol &&
110 + : dirty index should have prevented -u from checking it out. &&
111 + echo yomin yomin >yomin1 &&
112 + diff yomin yomin1 &&
113 + rm -f yomin1
114 +'
115 +
116 +test_expect_success '6 - local addition already has the same.' '
117 + rm -f .git/index nitfol bozbar rezrov frotz &&
118 + read_tree_u_must_succeed --reset -u $treeH &&
119 + echo frotz >frotz &&
120 + git update-index --add frotz &&
121 + read_tree_u_must_succeed -m -u $treeH $treeM &&
122 + git ls-files --stage >6.out &&
123 + test_cmp M.out 6.out &&
124 + check_cache_at frotz clean &&
125 + test_cmp bozbar.M bozbar &&
126 + test_cmp frotz.M frotz &&
127 + test_cmp nitfol.M nitfol &&
128 + echo frotz >frotz1 &&
129 + diff frotz frotz1 &&
130 + rm -f frotz1
131 +'
132 +
133 +test_expect_success '7 - local addition already has the same.' '
134 + rm -f .git/index nitfol bozbar rezrov frotz &&
135 + read_tree_u_must_succeed --reset -u $treeH &&
136 + echo frotz >frotz &&
137 + git update-index --add frotz &&
138 + echo frotz frotz >frotz &&
139 + read_tree_u_must_succeed -m -u $treeH $treeM &&
140 + git ls-files --stage >7.out &&
141 + test_cmp M.out 7.out &&
142 + check_cache_at frotz dirty &&
143 + test_cmp bozbar.M bozbar &&
144 + test_cmp nitfol.M nitfol &&
145 + : dirty index should have prevented -u from checking it out. &&
146 + echo frotz frotz >frotz1 &&
147 + diff frotz frotz1 &&
148 + rm -f frotz1
149 +'
150 +
151 +test_expect_success '8 - conflicting addition.' '
152 + rm -f .git/index nitfol bozbar rezrov frotz &&
153 + read_tree_u_must_succeed --reset -u $treeH &&
154 + echo frotz frotz >frotz &&
155 + git update-index --add frotz &&
156 + ! read_tree_u_must_succeed -m -u $treeH $treeM
157 +'
158 +
159 +test_expect_success '9 - conflicting addition.' '
160 + rm -f .git/index nitfol bozbar rezrov frotz &&
161 + read_tree_u_must_succeed --reset -u $treeH &&
162 + echo frotz frotz >frotz &&
163 + git update-index --add frotz &&
164 + echo frotz >frotz &&
165 + ! read_tree_u_must_succeed -m -u $treeH $treeM
166 +'
167 +
168 +test_expect_success '10 - path removed.' '
169 + rm -f .git/index nitfol bozbar rezrov frotz &&
170 + read_tree_u_must_succeed --reset -u $treeH &&
171 + echo rezrov >rezrov &&
172 + git update-index --add rezrov &&
173 + read_tree_u_must_succeed -m -u $treeH $treeM &&
174 + git ls-files --stage >10.out &&
175 + cmp M.out 10.out &&
176 + test_cmp bozbar.M bozbar &&
177 + test_cmp frotz.M frotz &&
178 + test_cmp nitfol.M nitfol
179 +'
180 +
181 +test_expect_success '11 - dirty path removed.' '
182 + rm -f .git/index nitfol bozbar rezrov frotz &&
183 + read_tree_u_must_succeed --reset -u $treeH &&
184 + echo rezrov >rezrov &&
185 + git update-index --add rezrov &&
186 + echo rezrov rezrov >rezrov &&
187 + ! read_tree_u_must_succeed -m -u $treeH $treeM
188 +'
189 +
190 +test_expect_success '12 - unmatching local changes being removed.' '
191 + rm -f .git/index nitfol bozbar rezrov frotz &&
192 + read_tree_u_must_succeed --reset -u $treeH &&
193 + echo rezrov rezrov >rezrov &&
194 + git update-index --add rezrov &&
195 + ! read_tree_u_must_succeed -m -u $treeH $treeM
196 +'
197 +
198 +test_expect_success '13 - unmatching local changes being removed.' '
199 + rm -f .git/index nitfol bozbar rezrov frotz &&
200 + read_tree_u_must_succeed --reset -u $treeH &&
201 + echo rezrov rezrov >rezrov &&
202 + git update-index --add rezrov &&
203 + echo rezrov >rezrov &&
204 + ! read_tree_u_must_succeed -m -u $treeH $treeM
205 +'
206
207 cat >expected <<EOF
208 -100644 X 0 nitfol
209 +100644 X 0 nitfol
210 EOF
211
213 -test_expect_success \
214 - '14 - unchanged in two heads.' \
215 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
216 - read_tree_u_must_succeed --reset -u $treeH &&
217 - echo nitfol nitfol >nitfol &&
218 - git update-index --add nitfol &&
219 - read_tree_u_must_succeed -m -u $treeH $treeM &&
220 - git ls-files --stage >14.out &&
221 - test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
222 - compare_change 14diff.out expected &&
223 - test_cmp bozbar.M bozbar &&
224 - test_cmp frotz.M frotz &&
225 - check_cache_at nitfol clean &&
226 - echo nitfol nitfol >nitfol1 &&
227 - diff nitfol nitfol1 &&
228 - rm -f nitfol1'
229 -
230 -test_expect_success \
231 - '15 - unchanged in two heads.' \
232 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
233 - read_tree_u_must_succeed --reset -u $treeH &&
234 - echo nitfol nitfol >nitfol &&
235 - git update-index --add nitfol &&
236 - echo nitfol nitfol nitfol >nitfol &&
237 - read_tree_u_must_succeed -m -u $treeH $treeM &&
238 - git ls-files --stage >15.out &&
239 - test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
240 - compare_change 15diff.out expected &&
241 - check_cache_at nitfol dirty &&
242 - test_cmp bozbar.M bozbar &&
243 - test_cmp frotz.M frotz &&
244 - echo nitfol nitfol nitfol >nitfol1 &&
245 - diff nitfol nitfol1 &&
246 - rm -f nitfol1'
247 -
248 -test_expect_success \
249 - '16 - conflicting local change.' \
250 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
251 - read_tree_u_must_succeed --reset -u $treeH &&
252 - echo bozbar bozbar >bozbar &&
253 - git update-index --add bozbar &&
254 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
255 -
256 -test_expect_success \
257 - '17 - conflicting local change.' \
258 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
259 - read_tree_u_must_succeed --reset -u $treeH &&
260 - echo bozbar bozbar >bozbar &&
261 - git update-index --add bozbar &&
262 - echo bozbar bozbar bozbar >bozbar &&
263 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
264 -
265 -test_expect_success \
266 - '18 - local change already having a good result.' \
267 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
268 - read_tree_u_must_succeed --reset -u $treeH &&
269 - echo gnusto >bozbar &&
270 - git update-index --add bozbar &&
271 - read_tree_u_must_succeed -m -u $treeH $treeM &&
272 - git ls-files --stage >18.out &&
273 - test_cmp M.out 18.out &&
274 - check_cache_at bozbar clean &&
275 - test_cmp bozbar.M bozbar &&
276 - test_cmp frotz.M frotz &&
277 - test_cmp nitfol.M nitfol
212 +test_expect_success '14 - unchanged in two heads.' '
213 + rm -f .git/index nitfol bozbar rezrov frotz &&
214 + read_tree_u_must_succeed --reset -u $treeH &&
215 + echo nitfol nitfol >nitfol &&
216 + git update-index --add nitfol &&
217 + read_tree_u_must_succeed -m -u $treeH $treeM &&
218 + git ls-files --stage >14.out &&
219 + test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
220 + compare_change 14diff.out expected &&
221 + test_cmp bozbar.M bozbar &&
222 + test_cmp frotz.M frotz &&
223 + check_cache_at nitfol clean &&
224 + echo nitfol nitfol >nitfol1 &&
225 + diff nitfol nitfol1 &&
226 + rm -f nitfol1
227 '
228
280 -test_expect_success \
281 - '19 - local change already having a good result, further modified.' \
282 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
283 - read_tree_u_must_succeed --reset -u $treeH &&
284 - echo gnusto >bozbar &&
285 - git update-index --add bozbar &&
286 - echo gnusto gnusto >bozbar &&
287 - read_tree_u_must_succeed -m -u $treeH $treeM &&
288 - git ls-files --stage >19.out &&
289 - test_cmp M.out 19.out &&
290 - check_cache_at bozbar dirty &&
291 - test_cmp frotz.M frotz &&
292 - test_cmp nitfol.M nitfol &&
293 - echo gnusto gnusto >bozbar1 &&
294 - diff bozbar bozbar1 &&
295 - rm -f bozbar1'
296 -
297 -test_expect_success \
298 - '20 - no local change, use new tree.' \
299 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
300 - read_tree_u_must_succeed --reset -u $treeH &&
301 - echo bozbar >bozbar &&
302 - git update-index --add bozbar &&
303 - read_tree_u_must_succeed -m -u $treeH $treeM &&
304 - git ls-files --stage >20.out &&
305 - test_cmp M.out 20.out &&
306 - check_cache_at bozbar clean &&
307 - test_cmp bozbar.M bozbar &&
308 - test_cmp frotz.M frotz &&
309 - test_cmp nitfol.M nitfol
229 +test_expect_success '15 - unchanged in two heads.' '
230 + rm -f .git/index nitfol bozbar rezrov frotz &&
231 + read_tree_u_must_succeed --reset -u $treeH &&
232 + echo nitfol nitfol >nitfol &&
233 + git update-index --add nitfol &&
234 + echo nitfol nitfol nitfol >nitfol &&
235 + read_tree_u_must_succeed -m -u $treeH $treeM &&
236 + git ls-files --stage >15.out &&
237 + test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
238 + compare_change 15diff.out expected &&
239 + check_cache_at nitfol dirty &&
240 + test_cmp bozbar.M bozbar &&
241 + test_cmp frotz.M frotz &&
242 + echo nitfol nitfol nitfol >nitfol1 &&
243 + diff nitfol nitfol1 &&
244 + rm -f nitfol1
245 '
246
312 -test_expect_success \
313 - '21 - no local change, dirty cache.' \
314 - 'rm -f .git/index nitfol bozbar rezrov frotz &&
315 - read_tree_u_must_succeed --reset -u $treeH &&
316 - echo bozbar >bozbar &&
317 - git update-index --add bozbar &&
318 - echo gnusto gnusto >bozbar &&
319 - ! read_tree_u_must_succeed -m -u $treeH $treeM'
247 +test_expect_success '16 - conflicting local change.' '
248 + rm -f .git/index nitfol bozbar rezrov frotz &&
249 + read_tree_u_must_succeed --reset -u $treeH &&
250 + echo bozbar bozbar >bozbar &&
251 + git update-index --add bozbar &&
252 + ! read_tree_u_must_succeed -m -u $treeH $treeM
253 +'
254 +
255 +test_expect_success '17 - conflicting local change.' '
256 + rm -f .git/index nitfol bozbar rezrov frotz &&
257 + read_tree_u_must_succeed --reset -u $treeH &&
258 + echo bozbar bozbar >bozbar &&
259 + git update-index --add bozbar &&
260 + echo bozbar bozbar bozbar >bozbar &&
261 + ! read_tree_u_must_succeed -m -u $treeH $treeM
262 +'
263 +
264 +test_expect_success '18 - local change already having a good result.' '
265 + rm -f .git/index nitfol bozbar rezrov frotz &&
266 + read_tree_u_must_succeed --reset -u $treeH &&
267 + echo gnusto >bozbar &&
268 + git update-index --add bozbar &&
269 + read_tree_u_must_succeed -m -u $treeH $treeM &&
270 + git ls-files --stage >18.out &&
271 + test_cmp M.out 18.out &&
272 + check_cache_at bozbar clean &&
273 + test_cmp bozbar.M bozbar &&
274 + test_cmp frotz.M frotz &&
275 + test_cmp nitfol.M nitfol
276 +'
277 +
278 +test_expect_success '19 - local change already having a good result, further modified.' '
279 + rm -f .git/index nitfol bozbar rezrov frotz &&
280 + read_tree_u_must_succeed --reset -u $treeH &&
281 + echo gnusto >bozbar &&
282 + git update-index --add bozbar &&
283 + echo gnusto gnusto >bozbar &&
284 + read_tree_u_must_succeed -m -u $treeH $treeM &&
285 + git ls-files --stage >19.out &&
286 + test_cmp M.out 19.out &&
287 + check_cache_at bozbar dirty &&
288 + test_cmp frotz.M frotz &&
289 + test_cmp nitfol.M nitfol &&
290 + echo gnusto gnusto >bozbar1 &&
291 + diff bozbar bozbar1 &&
292 + rm -f bozbar1
293 +'
294 +
295 +test_expect_success '20 - no local change, use new tree.' '
296 + rm -f .git/index nitfol bozbar rezrov frotz &&
297 + read_tree_u_must_succeed --reset -u $treeH &&
298 + echo bozbar >bozbar &&
299 + git update-index --add bozbar &&
300 + read_tree_u_must_succeed -m -u $treeH $treeM &&
301 + git ls-files --stage >20.out &&
302 + test_cmp M.out 20.out &&
303 + check_cache_at bozbar clean &&
304 + test_cmp bozbar.M bozbar &&
305 + test_cmp frotz.M frotz &&
306 + test_cmp nitfol.M nitfol
307 +'
308 +
309 +test_expect_success '21 - no local change, dirty cache.' '
310 + rm -f .git/index nitfol bozbar rezrov frotz &&
311 + read_tree_u_must_succeed --reset -u $treeH &&
312 + echo bozbar >bozbar &&
313 + git update-index --add bozbar &&
314 + echo gnusto gnusto >bozbar &&
315 + ! read_tree_u_must_succeed -m -u $treeH $treeM
316 +'
317
318 # Also make sure we did not break DF vs DF/DF case.
322 -test_expect_success \
323 - 'DF vs DF/DF case setup.' \
324 - 'rm -f .git/index &&
325 - echo DF >DF &&
326 - git update-index --add DF &&
327 - treeDF=$(git write-tree) &&
328 - echo treeDF $treeDF &&
329 - git ls-tree $treeDF &&
330 -
331 - rm -f DF &&
332 - mkdir DF &&
333 - echo DF/DF >DF/DF &&
334 - git update-index --add --remove DF DF/DF &&
335 - treeDFDF=$(git write-tree) &&
336 - echo treeDFDF $treeDFDF &&
337 - git ls-tree $treeDFDF &&
338 - git ls-files --stage >DFDF.out'
339 -
340 -test_expect_success \
341 - 'DF vs DF/DF case test.' \
342 - 'rm -f .git/index &&
343 - rm -fr DF &&
344 - echo DF >DF &&
345 - git update-index --add DF &&
346 - read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
347 - git ls-files --stage >DFDFcheck.out &&
348 - test_cmp DFDF.out DFDFcheck.out &&
349 - check_cache_at DF/DF clean'
319 +test_expect_success 'DF vs DF/DF case setup.' '
320 + rm -f .git/index &&
321 + echo DF >DF &&
322 + git update-index --add DF &&
323 + treeDF=$(git write-tree) &&
324 + echo treeDF $treeDF &&
325 + git ls-tree $treeDF &&
326 +
327 + rm -f DF &&
328 + mkdir DF &&
329 + echo DF/DF >DF/DF &&
330 + git update-index --add --remove DF DF/DF &&
331 + treeDFDF=$(git write-tree) &&
332 + echo treeDFDF $treeDFDF &&
333 + git ls-tree $treeDFDF &&
334 + git ls-files --stage >DFDF.out
335 +'
336 +
337 +test_expect_success 'DF vs DF/DF case test.' '
338 + rm -f .git/index &&
339 + rm -fr DF &&
340 + echo DF >DF &&
341 + git update-index --add DF &&
342 + read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
343 + git ls-files --stage >DFDFcheck.out &&
344 + test_cmp DFDF.out DFDFcheck.out &&
345 + check_cache_at DF/DF clean
346 +'
347
348 test_done