@@ -521,6 +521,113 @@ test_expect_success 'B: fail on invalid committer (5)' '
521
521
test_must_fail git fast-import <input
522
522
'
523
523
524
+ test_expect_success ' B: fail on invalid file path of ..' '
525
+ cat >input <<-INPUT_END &&
526
+ blob
527
+ mark :1
528
+ data <<EOF
529
+ File contents
530
+ EOF
531
+
532
+ commit refs/heads/badpath
533
+ committer Name <email> $GIT_COMMITTER_DATE
534
+ data <<COMMIT
535
+ Commit Message
536
+ COMMIT
537
+ M 100644 :1 ../invalid-path
538
+ INPUT_END
539
+
540
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
541
+ test_must_fail git fast-import <input
542
+ '
543
+
544
+ test_expect_success ' B: fail on invalid file path of .' '
545
+ cat >input <<-INPUT_END &&
546
+ blob
547
+ mark :1
548
+ data <<EOF
549
+ File contents
550
+ EOF
551
+
552
+ commit refs/heads/badpath
553
+ committer Name <email> $GIT_COMMITTER_DATE
554
+ data <<COMMIT
555
+ Good path
556
+ COMMIT
557
+ M 100644 :1 ok-path
558
+
559
+ commit refs/heads/badpath
560
+ committer Name <email> $GIT_COMMITTER_DATE
561
+ data <<COMMIT
562
+ Bad path
563
+ COMMIT
564
+ R ok-path ./invalid-path
565
+ INPUT_END
566
+
567
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
568
+ test_must_fail git fast-import <input
569
+ '
570
+
571
+ test_expect_success WINDOWS ' B: fail on invalid file path of C:' '
572
+ cat >input <<-INPUT_END &&
573
+ blob
574
+ mark :1
575
+ data <<EOF
576
+ File contents
577
+ EOF
578
+
579
+ commit refs/heads/badpath
580
+ committer Name <email> $GIT_COMMITTER_DATE
581
+ data <<COMMIT
582
+ Commit Message
583
+ COMMIT
584
+ M 100644 :1 C:/invalid-path
585
+ INPUT_END
586
+
587
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
588
+ test_must_fail git fast-import <input
589
+ '
590
+
591
+ test_expect_success ' B: fail on invalid file path of .git' '
592
+ cat >input <<-INPUT_END &&
593
+ blob
594
+ mark :1
595
+ data <<EOF
596
+ File contents
597
+ EOF
598
+
599
+ commit refs/heads/badpath
600
+ committer Name <email> $GIT_COMMITTER_DATE
601
+ data <<COMMIT
602
+ Commit Message
603
+ COMMIT
604
+ M 100644 :1 .git/invalid-path
605
+ INPUT_END
606
+
607
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
608
+ test_must_fail git fast-import <input
609
+ '
610
+
611
+ test_expect_success ' B: fail on invalid file path of .gitmodules' '
612
+ cat >input <<-INPUT_END &&
613
+ blob
614
+ mark :1
615
+ data <<EOF
616
+ File contents
617
+ EOF
618
+
619
+ commit refs/heads/badpath
620
+ committer Name <email> $GIT_COMMITTER_DATE
621
+ data <<COMMIT
622
+ Commit Message
623
+ COMMIT
624
+ M 120000 :1 .gitmodules
625
+ INPUT_END
626
+
627
+ test_when_finished "git update-ref -d refs/heads/badpath" &&
628
+ test_must_fail git fast-import <input
629
+ '
630
+
524
631
# ##
525
632
# ## series C
526
633
# ##
@@ -945,7 +1052,7 @@ test_expect_success 'L: verify internal tree sorting' '
945
1052
:100644 100644 M ba
946
1053
EXPECT_END
947
1054
948
- git fast-import <input &&
1055
+ git -c core.protectNTFS=false fast-import <input &&
949
1056
GIT_PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev --raw L^ L >output &&
950
1057
cut -d" " -f1,2,5 output >actual &&
951
1058
test_cmp expect actual
@@ -3096,7 +3203,7 @@ test_path_eol_success () {
3096
3203
test_expect_success " S: paths at EOL with $test must work" '
3097
3204
test_when_finished "git branch -D S-path-eol" &&
3098
3205
3099
- git fast-import --export-marks=marks.out <<-EOF >out 2>err &&
3206
+ git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF >out 2>err &&
3100
3207
blob
3101
3208
mark :401
3102
3209
data <<BLOB
@@ -3205,7 +3312,7 @@ test_path_space_success () {
3205
3312
test_expect_success " S: paths before space with $test must work" '
3206
3313
test_when_finished "git branch -D S-path-space" &&
3207
3314
3208
- git fast-import --export-marks=marks.out <<-EOF 2>err &&
3315
+ git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF 2>err &&
3209
3316
blob
3210
3317
mark :401
3211
3318
data <<BLOB
0 commit comments