Merge branch 'es/want-color-fd-defensive'
[gitweb.git] / t / t9146-git-svn-empty-dirs.sh
index 565365cbd3ff80d816dd02b2072045cd25ae4b93..5f91c0d68b4582958e2ba5e20e888b9369e6a3f4 100755 (executable)
@@ -21,7 +21,24 @@ test_expect_success 'empty directories exist' '
                do
                        if ! test -d "$i"
                        then
-                               echo >&2 "$i does not exist"
+                               echo >&2 "$i does not exist" &&
+                               exit 1
+                       fi
+               done
+       )
+'
+
+test_expect_success 'option automkdirs set to false' '
+       (
+               git svn init "$svnrepo" cloned-no-mkdirs &&
+               cd cloned-no-mkdirs &&
+               git config svn-remote.svn.automkdirs false &&
+               git svn fetch &&
+               for i in a b c d d/e d/e/f "weird file name"
+               do
+                       if test -d "$i"
+                       then
+                               echo >&2 "$i exists" &&
                                exit 1
                        fi
                done
@@ -33,7 +50,7 @@ test_expect_success 'more emptiness' '
 '
 
 test_expect_success 'git svn rebase creates empty directory' '
-       ( cd cloned && git svn rebase )
+       ( cd cloned && git svn rebase ) &&
        test -d cloned/"! !"
 '
 
@@ -46,7 +63,7 @@ test_expect_success 'git svn mkdirs recreates empty directories' '
                do
                        if ! test -d "$i"
                        then
-                               echo >&2 "$i does not exist"
+                               echo >&2 "$i does not exist" &&
                                exit 1
                        fi
                done
@@ -62,21 +79,21 @@ test_expect_success 'git svn mkdirs -r works' '
                do
                        if ! test -d "$i"
                        then
-                               echo >&2 "$i does not exist"
+                               echo >&2 "$i does not exist" &&
                                exit 1
                        fi
-               done
+               done &&
 
                if test -d "! !"
                then
-                       echo >&2 "$i should not exist"
+                       echo >&2 "$i should not exist" &&
                        exit 1
-               fi
+               fi &&
 
                git svn mkdirs -r8 &&
                if ! test -d "! !"
                then
-                       echo >&2 "$i not exist"
+                       echo >&2 "$i not exist" &&
                        exit 1
                fi
        )
@@ -98,7 +115,7 @@ test_expect_success 'empty directories in trunk exist' '
                do
                        if ! test -d "$i"
                        then
-                               echo >&2 "$i does not exist"
+                               echo >&2 "$i does not exist" &&
                                exit 1
                        fi
                done
@@ -131,7 +148,7 @@ test_expect_success 'git svn gc-ed files work' '
                        do
                                if ! test -d "$i"
                                then
-                                       echo >&2 "$i does not exist"
+                                       echo >&2 "$i does not exist" &&
                                        exit 1
                                fi
                        done