@@ -979,3 +979,69 @@ load 'common'
979
979
assert git -C git-repo show branch-a:dir-a/.gitignore
980
980
assert_equal " $( git -C git-repo show branch-a:dir-a/.gitignore) " ' '
981
981
}
982
+
983
+ @test ' branching with svn-ignore, svn-branches and empty-dirs parameter should not replace filled .gitignore files with empty ones' {
984
+ svn mkdir --parents trunk/dir-a
985
+ svn propset svn:ignore ' ignore-a' trunk/dir-a
986
+ svn commit -m ' add trunk/dir-a'
987
+ svn mkdir branches
988
+ svn cp trunk branches/branch-a
989
+ svn commit -m ' create branch-a'
990
+
991
+ cd " $TEST_TEMP_DIR "
992
+ svn2git " $SVN_REPO " --empty-dirs --svn-branches --svn-ignore --rules <( echo "
993
+ create repository git-repo
994
+ end repository
995
+
996
+ match /trunk/
997
+ repository git-repo
998
+ branch master
999
+ end match
1000
+
1001
+ match /branches/$
1002
+ action recurse
1003
+ end match
1004
+
1005
+ match /branches/([^/]+)/
1006
+ repository git-repo
1007
+ branch \1
1008
+ end match
1009
+ " )
1010
+
1011
+ assert_equal " $( git -C git-repo show master:dir-a/.gitignore) " ' /ignore-a'
1012
+ assert_equal " $( git -C git-repo show branch-a:dir-a/.gitignore) " ' /ignore-a'
1013
+ }
1014
+
1015
+ @test ' branching with svn-ignore, svn-branches and empty-dirs parameter should not replace filled .gitignore files with empty ones' {
1016
+ svn mkdir project-a
1017
+ cd project-a
1018
+ svn mkdir --parents trunk/dir-a
1019
+ svn propset svn:ignore ' ignore-a' trunk/dir-a
1020
+ svn commit -m ' add trunk/dir-a'
1021
+ svn mkdir branches
1022
+ svn cp trunk branches/branch-a
1023
+ svn commit -m ' create branch-a'
1024
+
1025
+ cd " $TEST_TEMP_DIR "
1026
+ svn2git " $SVN_REPO " --empty-dirs --svn-branches --svn-ignore --rules <( echo "
1027
+ create repository git-repo
1028
+ end repository
1029
+
1030
+ match /project-a/trunk/
1031
+ repository git-repo
1032
+ branch master
1033
+ end match
1034
+
1035
+ match /project-a/branches/([^/]+)/
1036
+ repository git-repo
1037
+ branch \1
1038
+ end match
1039
+
1040
+ match /project-a/(branches/)?$
1041
+ action recurse
1042
+ end match
1043
+ " )
1044
+
1045
+ assert_equal " $( git -C git-repo show master:dir-a/.gitignore) " ' /ignore-a'
1046
+ assert_equal " $( git -C git-repo show branch-a:dir-a/.gitignore) " ' /ignore-a'
1047
+ }
0 commit comments