@@ -461,3 +461,69 @@ load 'common'
461
461
assert git -C git-repo show master:dir-b/.gitignore
462
462
assert_equal " $( git -C git-repo show master:dir-b/.gitignore) " ' '
463
463
}
464
+
465
+ @test ' branching with svn-ignore, svn-branches and empty-dirs parameter should not replace filled .gitignore files with empty ones' {
466
+ svn mkdir --parents trunk/dir-a
467
+ svn propset svn:ignore ' ignore-a' trunk/dir-a
468
+ svn commit -m ' add trunk/dir-a'
469
+ svn mkdir branches
470
+ svn cp trunk branches/branch-a
471
+ svn commit -m ' create branch-a'
472
+
473
+ cd " $TEST_TEMP_DIR "
474
+ svn2git " $SVN_REPO " --empty-dirs --svn-branches --svn-ignore --rules <( echo "
475
+ create repository git-repo
476
+ end repository
477
+
478
+ match /trunk/
479
+ repository git-repo
480
+ branch master
481
+ end match
482
+
483
+ match /branches/$
484
+ action recurse
485
+ end match
486
+
487
+ match /branches/([^/]+)/
488
+ repository git-repo
489
+ branch \1
490
+ end match
491
+ " )
492
+
493
+ assert_equal " $( git -C git-repo show master:dir-a/.gitignore) " ' /ignore-a'
494
+ assert_equal " $( git -C git-repo show branch-a:dir-a/.gitignore) " ' /ignore-a'
495
+ }
496
+
497
+ @test ' branching with svn-ignore, svn-branches and empty-dirs parameter should not replace filled .gitignore files with empty ones' {
498
+ svn mkdir project-a
499
+ cd project-a
500
+ svn mkdir --parents trunk/dir-a
501
+ svn propset svn:ignore ' ignore-a' trunk/dir-a
502
+ svn commit -m ' add trunk/dir-a'
503
+ svn mkdir branches
504
+ svn cp trunk branches/branch-a
505
+ svn commit -m ' create branch-a'
506
+
507
+ cd " $TEST_TEMP_DIR "
508
+ svn2git " $SVN_REPO " --empty-dirs --svn-branches --svn-ignore --rules <( echo "
509
+ create repository git-repo
510
+ end repository
511
+
512
+ match /project-a/trunk/
513
+ repository git-repo
514
+ branch master
515
+ end match
516
+
517
+ match /project-a/branches/([^/]+)/
518
+ repository git-repo
519
+ branch \1
520
+ end match
521
+
522
+ match /project-a/(branches/)?$
523
+ action recurse
524
+ end match
525
+ " )
526
+
527
+ assert_equal " $( git -C git-repo show master:dir-a/.gitignore) " ' /ignore-a'
528
+ assert_equal " $( git -C git-repo show branch-a:dir-a/.gitignore) " ' /ignore-a'
529
+ }
0 commit comments