@@ -344,9 +344,9 @@ M 755 0000000000000000000000000000000000000001 zero1
344
344
345
345
INPUT_END
346
346
test_expect_success ' B: fail on invalid blob sha1' '
347
+ test_when_finished "rm -f .git/objects/pack_* .git/objects/index_*" &&
347
348
test_must_fail git fast-import <input
348
349
'
349
- rm -f .git/objects/pack_* .git/objects/index_*
350
350
351
351
cat > input << INPUT_END
352
352
commit TEMP_TAG
@@ -359,14 +359,13 @@ from refs/heads/master
359
359
360
360
INPUT_END
361
361
test_expect_success ' B: accept branch name "TEMP_TAG"' '
362
+ test_when_finished "rm -f .git/TEMP_TAG
363
+ git gc
364
+ git prune" &&
362
365
git fast-import <input &&
363
366
test -f .git/TEMP_TAG &&
364
367
test `git rev-parse master` = `git rev-parse TEMP_TAG^`
365
368
'
366
- rm -f .git/TEMP_TAG
367
-
368
- git gc 2> /dev/null > /dev/null
369
- git prune 2> /dev/null > /dev/null
370
369
371
370
cat > input << INPUT_END
372
371
commit refs/heads/empty-committer-1
@@ -376,15 +375,14 @@ empty commit
376
375
COMMIT
377
376
INPUT_END
378
377
test_expect_success ' B: accept empty committer' '
378
+ test_when_finished "git update-ref -d refs/heads/empty-committer-1
379
+ git gc
380
+ git prune" &&
379
381
git fast-import <input &&
380
382
out=$(git fsck) &&
381
383
echo "$out" &&
382
384
test -z "$out"
383
385
'
384
- git update-ref -d refs/heads/empty-committer-1 || true
385
-
386
- git gc 2> /dev/null > /dev/null
387
- git prune 2> /dev/null > /dev/null
388
386
389
387
cat > input << INPUT_END
390
388
commit refs/heads/empty-committer-2
@@ -394,15 +392,14 @@ empty commit
394
392
COMMIT
395
393
INPUT_END
396
394
test_expect_success ' B: accept and fixup committer with no name' '
395
+ test_when_finished "git update-ref -d refs/heads/empty-committer-2
396
+ git gc
397
+ git prune" &&
397
398
git fast-import <input &&
398
399
out=$(git fsck) &&
399
400
echo "$out" &&
400
401
test -z "$out"
401
402
'
402
- git update-ref -d refs/heads/empty-committer-2 || true
403
-
404
- git gc 2> /dev/null > /dev/null
405
- git prune 2> /dev/null > /dev/null
406
403
407
404
cat > input << INPUT_END
408
405
commit refs/heads/invalid-committer
@@ -412,9 +409,9 @@ empty commit
412
409
COMMIT
413
410
INPUT_END
414
411
test_expect_success ' B: fail on invalid committer (1)' '
412
+ test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
415
413
test_must_fail git fast-import <input
416
414
'
417
- git update-ref -d refs/heads/invalid-committer || true
418
415
419
416
cat > input << INPUT_END
420
417
commit refs/heads/invalid-committer
@@ -424,9 +421,9 @@ empty commit
424
421
COMMIT
425
422
INPUT_END
426
423
test_expect_success ' B: fail on invalid committer (2)' '
424
+ test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
427
425
test_must_fail git fast-import <input
428
426
'
429
- git update-ref -d refs/heads/invalid-committer || true
430
427
431
428
cat > input << INPUT_END
432
429
commit refs/heads/invalid-committer
@@ -436,9 +433,9 @@ empty commit
436
433
COMMIT
437
434
INPUT_END
438
435
test_expect_success ' B: fail on invalid committer (3)' '
436
+ test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
439
437
test_must_fail git fast-import <input
440
438
'
441
- git update-ref -d refs/heads/invalid-committer || true
442
439
443
440
cat > input << INPUT_END
444
441
commit refs/heads/invalid-committer
@@ -448,9 +445,9 @@ empty commit
448
445
COMMIT
449
446
INPUT_END
450
447
test_expect_success ' B: fail on invalid committer (4)' '
448
+ test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
451
449
test_must_fail git fast-import <input
452
450
'
453
- git update-ref -d refs/heads/invalid-committer || true
454
451
455
452
cat > input << INPUT_END
456
453
commit refs/heads/invalid-committer
@@ -460,9 +457,9 @@ empty commit
460
457
COMMIT
461
458
INPUT_END
462
459
test_expect_success ' B: fail on invalid committer (5)' '
460
+ test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
463
461
test_must_fail git fast-import <input
464
462
'
465
- git update-ref -d refs/heads/invalid-committer || true
466
463
467
464
# ##
468
465
# ## series C
@@ -914,15 +911,14 @@ g/b/h
914
911
EOF
915
912
916
913
test_expect_success ' L: nested tree copy does not corrupt deltas' '
914
+ test_when_finished "git update-ref -d refs/heads/L2" &&
917
915
git fast-import <input &&
918
916
git ls-tree L2 g/b/ >tmp &&
919
917
cat tmp | cut -f 2 >actual &&
920
918
test_cmp expect actual &&
921
919
git fsck `git rev-parse L2`
922
920
'
923
921
924
- git update-ref -d refs/heads/L2
925
-
926
922
# ##
927
923
# ## series M
928
924
# ##
0 commit comments