3 # Copyright (c) 2009 Eric Wong
5 test_description
='git svn creates empty directories'
7 TEST_FAILS_SANITIZE_LEAK
=true
10 test_expect_success
'initialize repo' '
11 for i in a b c d d/e d/e/f "weird file name"
13 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
17 test_expect_success
'clone' 'git svn clone "$svnrepo" cloned'
19 test_expect_success
'empty directories exist' '
22 for i in a b c d d/e d/e/f "weird file name"
26 echo >&2 "$i does not exist" &&
33 test_expect_success
'option automkdirs set to false' '
35 git svn init "$svnrepo" cloned-no-mkdirs &&
36 cd cloned-no-mkdirs &&
37 git config svn-remote.svn.automkdirs false &&
39 for i in a b c d d/e d/e/f "weird file name"
43 echo >&2 "$i exists" &&
50 test_expect_success
'more emptiness' '
51 svn_cmd mkdir -m "bang bang" "$svnrepo"/"! !"
54 test_expect_success
'git svn rebase creates empty directory' '
55 ( cd cloned && git svn rebase ) &&
59 test_expect_success
'git svn mkdirs recreates empty directories' '
64 for i in a b c d d/e d/e/f "weird file name" "! !"
68 echo >&2 "$i does not exist" &&
75 test_expect_success
'git svn mkdirs -r works' '
80 for i in a b c d d/e d/e/f "weird file name"
84 echo >&2 "$i does not exist" &&
91 echo >&2 "$i should not exist" &&
98 echo >&2 "$i not exist" &&
104 test_expect_success
'initialize trunk' '
105 for i in trunk trunk/a trunk/"weird file name"
107 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
111 test_expect_success
'clone trunk' 'git svn clone -s "$svnrepo" trunk'
113 test_expect_success
'empty directories in trunk exist' '
116 for i in a "weird file name"
120 echo >&2 "$i does not exist" &&
127 test_expect_success
'remove a top-level directory from svn' '
128 svn_cmd rm -m "remove d" "$svnrepo"/d
131 test_expect_success
'removed top-level directory does not exist' '
132 git svn clone "$svnrepo" removed &&
136 unhandled
=.git
/svn
/refs
/remotes
/git-svn
/unhandled.log
137 test_expect_success
'git svn gc-ed files work' '
141 : Compress::Zlib may not be available &&
142 if test -f "$unhandled".gz
144 svn_cmd mkdir -m gz "$svnrepo"/gz &&
145 git reset --hard $(git rev-list HEAD | tail -1) &&
147 test -f "$unhandled".gz &&
148 test -f "$unhandled" &&
149 for i in a b c "weird file name" gz "! !"
153 echo >&2 "$i does not exist" &&