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
'more emptiness' '
32 svn_cmd mkdir -m "bang bang" "$svnrepo"/"! !"
35 test_expect_success
'git svn rebase creates empty directory' '
36 ( cd cloned && git svn rebase )
40 test_expect_success
'git svn mkdirs recreates empty directories' '
45 for i in a b c d d/e d/e/f "weird file name" "! !"
49 echo >&2 "$i does not exist"
56 test_expect_success
'git svn mkdirs -r works' '
61 for i in a b c d d/e d/e/f "weird file name"
65 echo >&2 "$i does not exist"
72 echo >&2 "$i should not exist"
79 echo >&2 "$i not exist"
85 test_expect_success
'initialize trunk' '
86 for i in trunk trunk/a trunk/"weird file name"
88 svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
92 test_expect_success
'clone trunk' 'git svn clone -s "$svnrepo" trunk'
94 test_expect_success
'empty directories in trunk exist' '
97 for i in a "weird file name"
101 echo >&2 "$i does not exist"
108 test_expect_success
'remove a top-level directory from svn' '
109 svn_cmd rm -m "remove d" "$svnrepo"/d
112 test_expect_success
'removed top-level directory does not exist' '
113 git svn clone "$svnrepo" removed &&
117 unhandled
=.git
/svn
/refs
/remotes
/git-svn
/unhandled.log
118 test_expect_success
'git svn gc-ed files work' '
122 : Compress::Zlib may not be available &&
123 if test -f "$unhandled".gz
125 svn_cmd mkdir -m gz "$svnrepo"/gz &&
126 git reset --hard $(git rev-list HEAD | tail -1) &&
128 test -f "$unhandled".gz &&
129 test -f "$unhandled" &&
130 for i in a b c "weird file name" gz "! !"
134 echo >&2 "$i does not exist"