Skip to content

Commit e478a52

Browse files
john-caigitster
authored andcommitted
t5300-pack-object: modernize test format
Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1afebc9 commit e478a52

File tree

1 file changed

+92
-92
lines changed

1 file changed

+92
-92
lines changed

t/t5300-pack-object.sh

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ test_expect_success 'unpack with OFS_DELTA' '
208208
'
209209

210210
test_expect_success 'unpack with OFS_DELTA (core.fsyncmethod=batch)' '
211-
check_unpack test-3-${packname_3} obj-list "$BATCH_CONFIGURATION"
211+
check_unpack test-3-${packname_3} obj-list "$BATCH_CONFIGURATION"
212212
'
213213

214214
test_expect_success 'compare delta flavors' '
@@ -263,97 +263,97 @@ test_expect_success 'survive missing objects/pack directory' '
263263
)
264264
'
265265

266-
test_expect_success \
267-
'verify pack' \
268-
'git verify-pack test-1-${packname_1}.idx \
269-
test-2-${packname_2}.idx \
270-
test-3-${packname_3}.idx'
271-
272-
test_expect_success \
273-
'verify pack -v' \
274-
'git verify-pack -v test-1-${packname_1}.idx \
275-
test-2-${packname_2}.idx \
276-
test-3-${packname_3}.idx'
277-
278-
test_expect_success \
279-
'verify-pack catches mismatched .idx and .pack files' \
280-
'cat test-1-${packname_1}.idx >test-3.idx &&
281-
cat test-2-${packname_2}.pack >test-3.pack &&
282-
if git verify-pack test-3.idx
283-
then false
284-
else :;
285-
fi'
286-
287-
test_expect_success \
288-
'verify-pack catches a corrupted pack signature' \
289-
'cat test-1-${packname_1}.pack >test-3.pack &&
290-
echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
291-
if git verify-pack test-3.idx
292-
then false
293-
else :;
294-
fi'
295-
296-
test_expect_success \
297-
'verify-pack catches a corrupted pack version' \
298-
'cat test-1-${packname_1}.pack >test-3.pack &&
299-
echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
300-
if git verify-pack test-3.idx
301-
then false
302-
else :;
303-
fi'
304-
305-
test_expect_success \
306-
'verify-pack catches a corrupted type/size of the 1st packed object data' \
307-
'cat test-1-${packname_1}.pack >test-3.pack &&
308-
echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
309-
if git verify-pack test-3.idx
310-
then false
311-
else :;
312-
fi'
313-
314-
test_expect_success \
315-
'verify-pack catches a corrupted sum of the index file itself' \
316-
'l=$(wc -c <test-3.idx) &&
317-
l=$(expr $l - 20) &&
318-
cat test-1-${packname_1}.pack >test-3.pack &&
319-
printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
320-
if git verify-pack test-3.pack
321-
then false
322-
else :;
323-
fi'
324-
325-
test_expect_success \
326-
'build pack index for an existing pack' \
327-
'cat test-1-${packname_1}.pack >test-3.pack &&
328-
git index-pack -o tmp.idx test-3.pack &&
329-
cmp tmp.idx test-1-${packname_1}.idx &&
330-
331-
git index-pack --promisor=message test-3.pack &&
332-
cmp test-3.idx test-1-${packname_1}.idx &&
333-
echo message >expect &&
334-
test_cmp expect test-3.promisor &&
335-
336-
cat test-2-${packname_2}.pack >test-3.pack &&
337-
git index-pack -o tmp.idx test-2-${packname_2}.pack &&
338-
cmp tmp.idx test-2-${packname_2}.idx &&
339-
340-
git index-pack test-3.pack &&
341-
cmp test-3.idx test-2-${packname_2}.idx &&
342-
343-
cat test-3-${packname_3}.pack >test-3.pack &&
344-
git index-pack -o tmp.idx test-3-${packname_3}.pack &&
345-
cmp tmp.idx test-3-${packname_3}.idx &&
346-
347-
git index-pack test-3.pack &&
348-
cmp test-3.idx test-3-${packname_3}.idx &&
349-
350-
cat test-1-${packname_1}.pack >test-4.pack &&
351-
rm -f test-4.keep &&
352-
git index-pack --keep=why test-4.pack &&
353-
cmp test-1-${packname_1}.idx test-4.idx &&
354-
test -f test-4.keep &&
355-
356-
:'
266+
test_expect_success 'verify pack' '
267+
git verify-pack test-1-${packname_1}.idx \
268+
test-2-${packname_2}.idx \
269+
test-3-${packname_3}.idx
270+
'
271+
272+
test_expect_success 'verify pack -v' '
273+
git verify-pack -v test-1-${packname_1}.idx \
274+
test-2-${packname_2}.idx \
275+
test-3-${packname_3}.idx
276+
'
277+
278+
test_expect_success 'verify-pack catches mismatched .idx and .pack files' '
279+
cat test-1-${packname_1}.idx >test-3.idx &&
280+
cat test-2-${packname_2}.pack >test-3.pack &&
281+
if git verify-pack test-3.idx
282+
then false
283+
else :;
284+
fi
285+
'
286+
287+
test_expect_success 'verify-pack catches a corrupted pack signature' '
288+
cat test-1-${packname_1}.pack >test-3.pack &&
289+
echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
290+
if git verify-pack test-3.idx
291+
then false
292+
else :;
293+
fi
294+
'
295+
296+
test_expect_success 'verify-pack catches a corrupted pack version' '
297+
cat test-1-${packname_1}.pack >test-3.pack &&
298+
echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
299+
if git verify-pack test-3.idx
300+
then false
301+
else :;
302+
fi
303+
'
304+
305+
test_expect_success 'verify-pack catches a corrupted type/size of the 1st packed object data' '
306+
cat test-1-${packname_1}.pack >test-3.pack &&
307+
echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
308+
if git verify-pack test-3.idx
309+
then false
310+
else :;
311+
fi
312+
'
313+
314+
test_expect_success 'verify-pack catches a corrupted sum of the index file itself' '
315+
l=$(wc -c <test-3.idx) &&
316+
l=$(expr $l - 20) &&
317+
cat test-1-${packname_1}.pack >test-3.pack &&
318+
printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
319+
if git verify-pack test-3.pack
320+
then false
321+
else :;
322+
fi
323+
'
324+
325+
test_expect_success 'build pack index for an existing pack' '
326+
cat test-1-${packname_1}.pack >test-3.pack &&
327+
git index-pack -o tmp.idx test-3.pack &&
328+
cmp tmp.idx test-1-${packname_1}.idx &&
329+
330+
git index-pack --promisor=message test-3.pack &&
331+
cmp test-3.idx test-1-${packname_1}.idx &&
332+
echo message >expect &&
333+
test_cmp expect test-3.promisor &&
334+
335+
cat test-2-${packname_2}.pack >test-3.pack &&
336+
git index-pack -o tmp.idx test-2-${packname_2}.pack &&
337+
cmp tmp.idx test-2-${packname_2}.idx &&
338+
339+
git index-pack test-3.pack &&
340+
cmp test-3.idx test-2-${packname_2}.idx &&
341+
342+
cat test-3-${packname_3}.pack >test-3.pack &&
343+
git index-pack -o tmp.idx test-3-${packname_3}.pack &&
344+
cmp tmp.idx test-3-${packname_3}.idx &&
345+
346+
git index-pack test-3.pack &&
347+
cmp test-3.idx test-3-${packname_3}.idx &&
348+
349+
cat test-1-${packname_1}.pack >test-4.pack &&
350+
rm -f test-4.keep &&
351+
git index-pack --keep=why test-4.pack &&
352+
cmp test-1-${packname_1}.idx test-4.idx &&
353+
test -f test-4.keep &&
354+
355+
:
356+
'
357357

358358
test_expect_success 'unpacking with --strict' '
359359

0 commit comments

Comments
 (0)