1#!/bin/sh 2# 3# Copyright (c) 2009 Eric Wong 4 5test_description='git svn creates empty directories' 6. ./lib-git-svn.sh 7 8test_expect_success 'initialize repo'' 9 for i in a b c d d/e d/e/f "weird file name" 10 do 11 svn_cmd mkdir -m "mkdir$i" "$svnrepo"/"$i" 12 done 13' 14 15test_expect_success 'clone''git svn clone "$svnrepo" cloned' 16 17test_expect_success 'empty directories exist'' 18 ( 19 cd cloned && 20 for i in a b c d d/e d/e/f "weird file name" 21 do 22 if ! test -d "$i" 23 then 24 echo >&2 "$idoes not exist" 25 exit 1 26 fi 27 done 28 ) 29' 30 31test_expect_success 'more emptiness'' 32 svn_cmd mkdir -m "bang bang" "$svnrepo"/"! !" 33' 34 35test_expect_success 'git svn rebase creates empty directory'' 36 ( cd cloned && git svn rebase ) 37 test -d cloned/"! !" 38' 39 40test_expect_success 'git svn mkdirs recreates empty directories'' 41 ( 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" "! !" 46 do 47 if ! test -d "$i" 48 then 49 echo >&2 "$idoes not exist" 50 exit 1 51 fi 52 done 53 ) 54' 55 56test_expect_success 'git svn mkdirs -r works'' 57 ( 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" 62 do 63 if ! test -d "$i" 64 then 65 echo >&2 "$idoes not exist" 66 exit 1 67 fi 68 done 69 70 if test -d "! !" 71 then 72 echo >&2 "$ishould not exist" 73 exit 1 74 fi 75 76 git svn mkdirs -r8 && 77 if ! test -d "! !" 78 then 79 echo >&2 "$inot exist" 80 exit 1 81 fi 82 ) 83' 84 85test_expect_success 'initialize trunk'' 86 for i in trunk trunk/a trunk/"weird file name" 87 do 88 svn_cmd mkdir -m "mkdir$i" "$svnrepo"/"$i" 89 done 90' 91 92test_expect_success 'clone trunk''git svn clone -s "$svnrepo" trunk' 93 94test_expect_success 'empty directories in trunk exist'' 95 ( 96 cd trunk && 97 for i in a "weird file name" 98 do 99 if ! test -d "$i" 100 then 101 echo >&2 "$idoes not exist" 102 exit 1 103 fi 104 done 105 ) 106' 107 108test_done