3 # Copyright (c) 2009 Eric Wong
5 test_description='git svn creates empty directories'
8 test_expect_success 'initialize repo' '
9 for i in a b c d d/e d/e/f "weird file name"
11 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
15 test_expect_success 'clone' 'git svn clone "$svnrepo" cloned'
17 test_expect_success 'empty directories exist' '
20 for i in a b c d d/e d/e/f "weird file name"
24 echo >&2 "$i does not exist"
31 test_expect_success 'option automkdirs set to false' '
33 git svn init "$svnrepo" cloned-no-mkdirs &&
34 cd cloned-no-mkdirs &&
35 git config svn-remote.svn.automkdirs false &&
37 for i in a b c d d/e d/e/f "weird file name"
48 test_expect_success 'more emptiness' '
49 svn_cmd mkdir -m "bang bang" "$svnrepo"/"! !"
52 test_expect_success 'git svn rebase creates empty directory' '
53 ( cd cloned && git svn rebase ) &&
57 test_expect_success 'git svn mkdirs recreates empty directories' '
62 for i in a b c d d/e d/e/f "weird file name" "! !"
66 echo >&2 "$i does not exist"
73 test_expect_success 'git svn mkdirs -r works' '
78 for i in a b c d d/e d/e/f "weird file name"
82 echo >&2 "$i does not exist"
89 echo >&2 "$i should not exist"
96 echo >&2 "$i not exist"
102 test_expect_success 'initialize trunk' '
103 for i in trunk trunk/a trunk/"weird file name"
105 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
109 test_expect_success 'clone trunk' 'git svn clone -s "$svnrepo" trunk'
111 test_expect_success 'empty directories in trunk exist' '
114 for i in a "weird file name"
118 echo >&2 "$i does not exist"
125 test_expect_success 'remove a top-level directory from svn' '
126 svn_cmd rm -m "remove d" "$svnrepo"/d
129 test_expect_success 'removed top-level directory does not exist' '
130 git svn clone "$svnrepo" removed &&
134 unhandled=.git/svn/refs/remotes/git-svn/unhandled.log
135 test_expect_success 'git svn gc-ed files work' '
139 : Compress::Zlib may not be available &&
140 if test -f "$unhandled".gz
142 svn_cmd mkdir -m gz "$svnrepo"/gz &&
143 git reset --hard $(git rev-list HEAD | tail -1) &&
145 test -f "$unhandled".gz &&
146 test -f "$unhandled" &&
147 for i in a b c "weird file name" gz "! !"
151 echo >&2 "$i does not exist"