@@ -51,7 +51,8 @@ filter_testcase degenerate degenerate-keepme-noff --path moduleA/keepme --no-ff
51
51
filter_testcase unusual unusual-filtered --path ' '
52
52
filter_testcase unusual unusual-mailmap --mailmap ../t9390/sample-mailmap
53
53
54
- test_expect_success ' setup path_rename' '
54
+ setup_path_rename () {
55
+ test -d path_rename && return
55
56
test_create_repo path_rename &&
56
57
(
57
58
cd path_rename &&
@@ -79,9 +80,10 @@ test_expect_success 'setup path_rename' '
79
80
git add sequences/medium &&
80
81
git commit -m final
81
82
)
82
- '
83
+ }
83
84
84
85
test_expect_success ' --path-rename sequences/tiny:sequences/small' '
86
+ setup_path_rename &&
85
87
(
86
88
git clone file://"$(pwd)"/path_rename path_rename_single &&
87
89
cd path_rename_single &&
@@ -94,6 +96,7 @@ test_expect_success '--path-rename sequences/tiny:sequences/small' '
94
96
'
95
97
96
98
test_expect_success ' --path-rename sequences:numbers' '
99
+ setup_path_rename &&
97
100
(
98
101
git clone file://"$(pwd)"/path_rename path_rename_dir &&
99
102
cd path_rename_dir &&
@@ -107,6 +110,7 @@ test_expect_success '--path-rename sequences:numbers' '
107
110
'
108
111
109
112
test_expect_success ' --path-rename-prefix values:numbers' '
113
+ setup_path_rename &&
110
114
(
111
115
git clone file://"$(pwd)"/path_rename path_rename_dir_2 &&
112
116
cd path_rename_dir_2 &&
@@ -120,6 +124,7 @@ test_expect_success '--path-rename-prefix values:numbers' '
120
124
'
121
125
122
126
test_expect_success ' --path-rename squashing' '
127
+ setup_path_rename &&
123
128
(
124
129
git clone file://"$(pwd)"/path_rename path_rename_squash &&
125
130
cd path_rename_squash &&
@@ -138,6 +143,7 @@ test_expect_success '--path-rename squashing' '
138
143
'
139
144
140
145
test_expect_success ' --path-rename inability to squash' '
146
+ setup_path_rename &&
141
147
(
142
148
git clone file://"$(pwd)"/path_rename path_rename_bad_squash &&
143
149
cd path_rename_bad_squash &&
@@ -149,6 +155,7 @@ test_expect_success '--path-rename inability to squash' '
149
155
'
150
156
151
157
test_expect_success ' --paths-from-file' '
158
+ setup_path_rename &&
152
159
(
153
160
git clone file://"$(pwd)"/path_rename paths_from_file &&
154
161
cd paths_from_file &&
@@ -257,7 +264,8 @@ test_expect_success 'Mixing filtering and to-subdirectory-filter' '
257
264
)
258
265
'
259
266
260
- test_expect_success ' setup metasyntactic repo' '
267
+ setup_metasyntactic_repo () {
268
+ test -d metasyntactic && return
261
269
test_create_repo metasyntactic &&
262
270
(
263
271
cd metasyntactic &&
@@ -287,9 +295,10 @@ test_expect_success 'setup metasyntactic repo' '
287
295
git commit -m more.words &&
288
296
git tag -a -m " Look, ma, I made a tag" v3.0
289
297
)
290
- '
298
+ }
291
299
292
300
test_expect_success ' --tag-rename' '
301
+ setup_metasyntactic_repo &&
293
302
(
294
303
git clone file://"$(pwd)"/metasyntactic tag_rename &&
295
304
cd tag_rename &&
@@ -308,6 +317,7 @@ test_expect_success '--tag-rename' '
308
317
'
309
318
310
319
test_expect_success ' --subdirectory-filter' '
320
+ setup_metasyntactic_repo &&
311
321
(
312
322
git clone file://"$(pwd)"/metasyntactic subdir_filter &&
313
323
cd subdir_filter &&
@@ -326,6 +336,7 @@ test_expect_success '--subdirectory-filter' '
326
336
'
327
337
328
338
test_expect_success ' --subdirectory-filter with trailing slash' '
339
+ setup_metasyntactic_repo &&
329
340
(
330
341
git clone file://"$(pwd)"/metasyntactic subdir_filter_2 &&
331
342
cd subdir_filter_2 &&
@@ -344,6 +355,7 @@ test_expect_success '--subdirectory-filter with trailing slash' '
344
355
'
345
356
346
357
test_expect_success ' --to-subdirectory-filter' '
358
+ setup_metasyntactic_repo &&
347
359
(
348
360
git clone file://"$(pwd)"/metasyntactic to_subdir_filter &&
349
361
cd to_subdir_filter &&
@@ -363,6 +375,7 @@ test_expect_success '--to-subdirectory-filter' '
363
375
'
364
376
365
377
test_expect_success ' --use-base-name' '
378
+ setup_metasyntactic_repo &&
366
379
(
367
380
git clone file://"$(pwd)"/metasyntactic use_base_name &&
368
381
cd use_base_name &&
@@ -381,6 +394,7 @@ test_expect_success '--use-base-name' '
381
394
'
382
395
383
396
test_expect_success ' refs/replace/ to skip a parent' '
397
+ setup_metasyntactic_repo &&
384
398
(
385
399
git clone file://"$(pwd)"/metasyntactic replace_skip_ref &&
386
400
cd replace_skip_ref &&
@@ -402,6 +416,7 @@ test_expect_success 'refs/replace/ to skip a parent' '
402
416
'
403
417
404
418
test_expect_success ' refs/replace/ to add more initial history' '
419
+ setup_metasyntactic_repo &&
405
420
(
406
421
git clone file://"$(pwd)"/metasyntactic replace_add_refs &&
407
422
cd replace_add_refs &&
@@ -436,6 +451,7 @@ test_expect_success 'refs/replace/ to add more initial history' '
436
451
'
437
452
438
453
test_expect_success ' creation/deletion/updating of replace refs' '
454
+ setup_metasyntactic_repo &&
439
455
(
440
456
git clone file://"$(pwd)"/metasyntactic replace_handling &&
441
457
@@ -494,6 +510,7 @@ test_expect_success 'creation/deletion/updating of replace refs' '
494
510
'
495
511
496
512
test_expect_success ' --debug' '
513
+ setup_metasyntactic_repo &&
497
514
(
498
515
git clone file://"$(pwd)"/metasyntactic debug &&
499
516
cd debug &&
@@ -516,6 +533,7 @@ test_expect_success '--debug' '
516
533
'
517
534
518
535
test_expect_success ' --dry-run' '
536
+ setup_metasyntactic_repo &&
519
537
(
520
538
git clone file://"$(pwd)"/metasyntactic dry_run &&
521
539
cd dry_run &&
@@ -543,6 +561,7 @@ test_expect_success '--dry-run' '
543
561
'
544
562
545
563
test_expect_success ' --dry-run --debug' '
564
+ setup_metasyntactic_repo &&
546
565
(
547
566
git clone file://"$(pwd)"/metasyntactic dry_run_debug &&
548
567
cd dry_run_debug &&
@@ -570,6 +589,7 @@ test_expect_success '--dry-run --debug' '
570
589
'
571
590
572
591
test_expect_success ' --dry-run --stdin' '
592
+ setup_metasyntactic_repo &&
573
593
(
574
594
git clone file://"$(pwd)"/metasyntactic dry_run_stdin &&
575
595
cd dry_run_stdin &&
@@ -594,7 +614,8 @@ test_expect_success '--dry-run --stdin' '
594
614
)
595
615
'
596
616
597
- test_expect_success ' setup analyze_me' '
617
+ setup_analyze_me () {
618
+ test -d analyze_me && return
598
619
test_create_repo analyze_me &&
599
620
(
600
621
cd analyze_me &&
@@ -666,9 +687,10 @@ test_expect_success 'setup analyze_me' '
666
687
# Add a random extra unreferenced object
667
688
echo foobar | git hash-object --stdin -w
668
689
)
669
- '
690
+ }
670
691
671
692
test_expect_success C_LOCALE_OUTPUT ' --analyze' '
693
+ setup_analyze_me &&
672
694
(
673
695
cd analyze_me &&
674
696
@@ -777,6 +799,7 @@ test_expect_success C_LOCALE_OUTPUT '--analyze' '
777
799
'
778
800
779
801
test_expect_success ' --replace-text all options' '
802
+ setup_analyze_me &&
780
803
(
781
804
git clone file://"$(pwd)"/analyze_me replace_text &&
782
805
cd replace_text &&
@@ -801,6 +824,7 @@ test_expect_success '--replace-text all options' '
801
824
'
802
825
803
826
test_expect_success ' --strip-blobs-bigger-than' '
827
+ setup_analyze_me &&
804
828
(
805
829
git clone file://"$(pwd)"/analyze_me strip_big_blobs &&
806
830
cd strip_big_blobs &&
@@ -856,6 +880,7 @@ test_expect_success '--strip-blobs-bigger-than' '
856
880
'
857
881
858
882
test_expect_success ' --strip-blobs-with-ids' '
883
+ setup_analyze_me &&
859
884
(
860
885
git clone file://"$(pwd)"/analyze_me strip_blobs_with_ids &&
861
886
cd strip_blobs_with_ids &&
@@ -900,7 +925,8 @@ test_expect_success '--strip-blobs-with-ids' '
900
925
)
901
926
'
902
927
903
- test_expect_success ' setup commit message rewriting' '
928
+ setup_commit_message_rewriting () {
929
+ test -d commit_msg && return
904
930
test_create_repo commit_msg &&
905
931
(
906
932
cd commit_msg &&
@@ -931,9 +957,10 @@ test_expect_success 'setup commit message rewriting' '
931
957
git add baz &&
932
958
git commit
933
959
)
934
- '
960
+ }
935
961
936
962
test_expect_success ' commit message rewrite' '
963
+ setup_commit_message_rewriting &&
937
964
(
938
965
git clone file://"$(pwd)"/commit_msg commit_msg_clone &&
939
966
cd commit_msg_clone &&
@@ -960,6 +987,7 @@ test_expect_success 'commit message rewrite' '
960
987
'
961
988
962
989
test_expect_success ' commit hash unchanged if requested' '
990
+ setup_commit_message_rewriting &&
963
991
(
964
992
git clone file://"$(pwd)"/commit_msg commit_msg_clone_2 &&
965
993
cd commit_msg_clone_2 &&
@@ -1048,6 +1076,7 @@ test_expect_success 'commit message rewrite unsuccessful' '
1048
1076
'
1049
1077
1050
1078
test_expect_success ' startup sanity checks' '
1079
+ setup_analyze_me &&
1051
1080
(
1052
1081
git clone file://"$(pwd)"/analyze_me startup_sanity_checks &&
1053
1082
cd startup_sanity_checks &&
@@ -1222,6 +1251,7 @@ test_expect_success 'invalid fast-import directives' '
1222
1251
'
1223
1252
1224
1253
test_expect_success ' mailmap sanity checks' '
1254
+ setup_analyze_me &&
1225
1255
(
1226
1256
git clone file://"$(pwd)"/analyze_me mailmap_sanity_checks &&
1227
1257
cd mailmap_sanity_checks &&
@@ -1244,6 +1274,7 @@ test_expect_success 'mailmap sanity checks' '
1244
1274
'
1245
1275
1246
1276
test_expect_success ' incremental import' '
1277
+ setup_analyze_me &&
1247
1278
(
1248
1279
git clone file://"$(pwd)"/analyze_me incremental &&
1249
1280
cd incremental &&
@@ -1256,6 +1287,7 @@ test_expect_success 'incremental import' '
1256
1287
'
1257
1288
1258
1289
test_expect_success ' --target' '
1290
+ setup_analyze_me &&
1259
1291
git init target &&
1260
1292
(
1261
1293
cd target &&
@@ -1274,6 +1306,7 @@ test_expect_success '--target' '
1274
1306
'
1275
1307
1276
1308
test_expect_success ' --refs' '
1309
+ setup_analyze_me &&
1277
1310
git init refs &&
1278
1311
(
1279
1312
cd refs &&
@@ -1313,7 +1346,8 @@ test_expect_success 'reset to specific refs' '
1313
1346
)
1314
1347
'
1315
1348
1316
- test_expect_success ' setup handle funny characters' '
1349
+ setup_handle_funny_characters () {
1350
+ test -d funny_chars && return
1317
1351
test_create_repo funny_chars &&
1318
1352
(
1319
1353
cd funny_chars &&
@@ -1345,9 +1379,10 @@ test_expect_success 'setup handle funny characters' '
1345
1379
1346
1380
git tag -a -m " ₪₽£€$" סְפָרַד
1347
1381
)
1348
- '
1382
+ }
1349
1383
1350
1384
test_expect_success ' handle funny characters' '
1385
+ setup_handle_funny_characters &&
1351
1386
(
1352
1387
git clone file://"$(pwd)"/funny_chars funny_chars_checks &&
1353
1388
cd funny_chars_checks &&
0 commit comments