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"
25 echo >&2 "$i does not exist" &&
32 test_expect_success
'option automkdirs set to false' '
34 git svn init "$svnrepo" cloned-no-mkdirs &&
35 cd cloned-no-mkdirs &&
36 git config svn-remote.svn.automkdirs false &&
38 for i in a b c d d/e d/e/f "weird file name"
42 echo >&2 "$i exists" &&
49 test_expect_success
'more emptiness' '
50 svn_cmd mkdir -m "bang bang" "$svnrepo"/"! !"
53 test_expect_success
'git svn rebase creates empty directory' '
54 ( cd cloned && git svn rebase ) &&
58 test_expect_success
'git svn mkdirs recreates empty directories' '
63 for i in a b c d d/e d/e/f "weird file name" "! !"
67 echo >&2 "$i does not exist" &&
74 test_expect_success
'git svn mkdirs -r works' '
79 for i in a b c d d/e d/e/f "weird file name"
83 echo >&2 "$i does not exist" &&
90 echo >&2 "$i should not exist" &&
97 echo >&2 "$i not exist" &&
103 test_expect_success
'initialize trunk' '
104 for i in trunk trunk/a trunk/"weird file name"
106 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
110 test_expect_success
'clone trunk' 'git svn clone -s "$svnrepo" trunk'
112 test_expect_success
'empty directories in trunk exist' '
115 for i in a "weird file name"
119 echo >&2 "$i does not exist" &&
126 test_expect_success
'remove a top-level directory from svn' '
127 svn_cmd rm -m "remove d" "$svnrepo"/d
130 test_expect_success
'removed top-level directory does not exist' '
131 git svn clone "$svnrepo" removed &&
135 unhandled
=.git
/svn
/refs
/remotes
/git-svn
/unhandled.log
136 test_expect_success
'git svn gc-ed files work' '
140 : Compress::Zlib may not be available &&
141 if test -f "$unhandled".gz
143 svn_cmd mkdir -m gz "$svnrepo"/gz &&
144 git reset --hard $(git rev-list HEAD | tail -1) &&
146 test -f "$unhandled".gz &&
147 test -f "$unhandled" &&
148 for i in a b c "weird file name" gz "! !"
152 echo >&2 "$i does not exist" &&