Skip to content

Commit 572a8ba

Browse files
Vampiretnyblom
authored andcommitted
Add test that copying a directory with empty sub-dirs should put empty .gitignore files to empty directories with empty-dirs parameter
1 parent 0498b68 commit 572a8ba

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

test/empty-dirs.bats

+48
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,54 @@ load 'common'
912912
assert_equal "$(git -C git-repo show master:dir-b/.gitignore)" ''
913913
}
914914

915+
@test 'copying a directory with empty sub-dirs should put empty .gitignore files to empty directories with empty-dirs parameter' {
916+
svn mkdir --parents dir-a/subdir-a
917+
svn commit -m 'add dir-a/subdir-a'
918+
svn cp dir-a dir-b
919+
svn commit -m 'copy dir-a to dir-b'
920+
921+
cd "$TEST_TEMP_DIR"
922+
svn2git "$SVN_REPO" --empty-dirs --rules <(echo "
923+
create repository git-repo
924+
end repository
925+
926+
match /
927+
repository git-repo
928+
branch master
929+
end match
930+
")
931+
932+
assert git -C git-repo show master:dir-a/subdir-a/.gitignore
933+
assert_equal "$(git -C git-repo show master:dir-a/subdir-a/.gitignore)" ''
934+
assert git -C git-repo show master:dir-b/subdir-a/.gitignore
935+
assert_equal "$(git -C git-repo show master:dir-b/subdir-a/.gitignore)" ''
936+
}
937+
938+
@test 'copying a directory with empty sub-dirs should put empty .gitignore files to empty directories with empty-dirs parameter (nested)' {
939+
svn mkdir project-a
940+
cd project-a
941+
svn mkdir --parents dir-a/subdir-a
942+
svn commit -m 'add dir-a/subdir-a'
943+
svn cp dir-a dir-b
944+
svn commit -m 'copy dir-a to dir-b'
945+
946+
cd "$TEST_TEMP_DIR"
947+
svn2git "$SVN_REPO" --empty-dirs --rules <(echo "
948+
create repository git-repo
949+
end repository
950+
951+
match /project-a/
952+
repository git-repo
953+
branch master
954+
end match
955+
")
956+
957+
assert git -C git-repo show master:dir-a/subdir-a/.gitignore
958+
assert_equal "$(git -C git-repo show master:dir-a/subdir-a/.gitignore)" ''
959+
assert git -C git-repo show master:dir-b/subdir-a/.gitignore
960+
assert_equal "$(git -C git-repo show master:dir-b/subdir-a/.gitignore)" ''
961+
}
962+
915963
@test 'branching with svn-branches and empty-dirs parameter should put empty .gitignore files to empty directories' {
916964
svn mkdir --parents trunk/dir-a
917965
svn commit -m 'add trunk/dir-a'

0 commit comments

Comments
 (0)