3 # Copyright (c) 2009 Eric Wong
5 test_description
='git svn creates empty directories'
9 test_expect_success
'initialize repo' '
10 for i in a b c d d/e d/e/f "weird file name"
12 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
16 test_expect_success
'clone' 'git svn clone "$svnrepo" cloned'
18 test_expect_success
'empty directories exist' '
21 for i in a b c d d/e d/e/f "weird file name"
23 test_path_is_dir "$i" || exit 1
28 test_expect_success
'option automkdirs set to false' '
30 git svn init "$svnrepo" cloned-no-mkdirs &&
31 cd cloned-no-mkdirs &&
32 git config svn-remote.svn.automkdirs false &&
34 for i in a b c d d/e d/e/f "weird file name"
36 test_path_is_missing "$i" || exit 1
41 test_expect_success
'more emptiness' '
42 svn_cmd mkdir -m "bang bang" "$svnrepo"/"! !"
45 test_expect_success
'git svn rebase creates empty directory' '
46 ( cd cloned && git svn rebase ) &&
47 test_path_is_dir cloned/"! !"
50 test_expect_success
'git svn mkdirs recreates empty directories' '
55 for i in a b c d d/e d/e/f "weird file name" "! !"
57 test_path_is_dir "$i" || exit 1
62 test_expect_success
'git svn mkdirs -r works' '
67 for i in a b c d d/e d/e/f "weird file name"
69 test_path_is_dir "$i" || exit 1
72 test_path_is_missing "! !" || exit 1 &&
75 test_path_is_dir "! !" || exit 1
79 test_expect_success
'initialize trunk' '
80 for i in trunk trunk/a trunk/"weird file name"
82 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
86 test_expect_success
'clone trunk' 'git svn clone -s "$svnrepo" trunk'
88 test_expect_success
'empty directories in trunk exist' '
91 for i in a "weird file name"
93 test_path_is_dir "$i" || exit 1
98 test_expect_success
'remove a top-level directory from svn' '
99 svn_cmd rm -m "remove d" "$svnrepo"/d
102 test_expect_success
'removed top-level directory does not exist' '
103 git svn clone "$svnrepo" removed &&
104 test_path_is_missing removed/d
107 unhandled
=.git
/svn
/refs
/remotes
/git-svn
/unhandled.log
108 test_expect_success
'git svn gc-ed files work' '
112 : Compress::Zlib may not be available &&
113 if test -f "$unhandled".gz
115 svn_cmd mkdir -m gz "$svnrepo"/gz &&
116 git reset --hard $(git rev-list HEAD | tail -1) &&
118 test_path_is_file "$unhandled".gz &&
119 test_path_is_file "$unhandled" &&
120 for i in a b c "weird file name" gz "! !"
122 test_path_is_dir "$i" || exit 1