apply: Use the term "working tree" consistently
[alt-git.git] / t / t9146-git-svn-empty-dirs.sh
blob5948544ec580dd6d55a9a0393792048a377e749a
1 #!/bin/sh
3 # Copyright (c) 2009 Eric Wong
5 test_description='git svn creates empty directories'
6 . ./lib-git-svn.sh
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"
12 done
15 test_expect_success 'clone' 'git svn clone "$svnrepo" cloned'
17 test_expect_success 'empty directories exist' '
19 cd cloned &&
20 for i in a b c d d/e d/e/f "weird file name"
22 if ! test -d "$i"
23 then
24 echo >&2 "$i does not exist"
25 exit 1
27 done
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 )
37 test -d cloned/"! !"
40 test_expect_success 'git svn mkdirs recreates empty directories' '
42 cd cloned &&
43 rm -r * &&
44 git svn mkdirs &&
45 for i in a b c d d/e d/e/f "weird file name" "! !"
47 if ! test -d "$i"
48 then
49 echo >&2 "$i does not exist"
50 exit 1
52 done
56 test_expect_success 'git svn mkdirs -r works' '
58 cd cloned &&
59 rm -r * &&
60 git svn mkdirs -r7 &&
61 for i in a b c d d/e d/e/f "weird file name"
63 if ! test -d "$i"
64 then
65 echo >&2 "$i does not exist"
66 exit 1
68 done
70 if test -d "! !"
71 then
72 echo >&2 "$i should not exist"
73 exit 1
76 git svn mkdirs -r8 &&
77 if ! test -d "! !"
78 then
79 echo >&2 "$i not exist"
80 exit 1
85 test_done