3 # Copyright (c) 2009 Vitaly Shukela
4 # Copyright (c) 2009 Eric Wong
7 test_description='git svn property tests'
10 test_expect_success 'setup test repository' '
11 svn co "$svnrepo" s &&
15 echo test_qqq > qqq/test_qqq.txt &&
16 echo test_www > www/test_www.txt &&
19 svn commit -m "create some files" &&
21 echo hi >> www/test_www.txt &&
22 svn commit -m "modify www/test_www.txt" &&
27 test_expect_success 'clone an SVN repository with ignored www directory' '
28 git svn clone --ignore-paths="^www" "$svnrepo" g &&
29 echo test_qqq > expect &&
30 for i in g/*/*.txt; do cat $i >> expect2; done &&
31 test_cmp expect expect2
34 test_expect_success 'init+fetch an SVN repository with ignored www directory' '
35 git svn init "$svnrepo" c &&
36 ( cd c && git svn fetch --ignore-paths="^www" ) &&
38 echo test_qqq > expect &&
39 for i in c/*/*.txt; do cat $i >> expect2; done &&
40 test_cmp expect expect2
43 test_expect_success 'verify ignore-paths config saved by clone' '
46 git config --get svn-remote.svn.ignore-paths | fgrep "www"
50 test_expect_success 'SVN-side change outside of www' '
53 echo b >> qqq/test_qqq.txt &&
54 svn commit -m "SVN-side change outside of www" &&
56 svn log -v | fgrep "SVN-side change outside of www"
60 test_expect_success 'update git svn-cloned repo (config ignore)' '
64 printf "test_qqq\nb\n" > expect &&
65 for i in */*.txt; do cat $i >> expect2; done &&
66 test_cmp expect2 expect &&
71 test_expect_success 'update git svn-cloned repo (option ignore)' '
74 git svn rebase --ignore-paths="^www" &&
75 printf "test_qqq\nb\n" > expect &&
76 for i in */*.txt; do cat $i >> expect2; done &&
77 test_cmp expect2 expect &&
82 test_expect_success 'SVN-side change inside of ignored www' '
85 echo zaq >> www/test_www.txt
86 svn commit -m "SVN-side change inside of www/test_www.txt" &&
88 svn log -v | fgrep "SVN-side change inside of www/test_www.txt"
92 test_expect_success 'update git svn-cloned repo (config ignore)' '
96 printf "test_qqq\nb\n" > expect &&
97 for i in */*.txt; do cat $i >> expect2; done &&
98 test_cmp expect2 expect &&
103 test_expect_success 'update git svn-cloned repo (option ignore)' '
106 git svn rebase --ignore-paths="^www" &&
107 printf "test_qqq\nb\n" > expect &&
108 for i in */*.txt; do cat $i >> expect2; done &&
109 test_cmp expect2 expect &&
114 test_expect_success 'SVN-side change in and out of ignored www' '
117 echo cvf >> www/test_www.txt
118 echo ygg >> qqq/test_qqq.txt
119 svn commit -m "SVN-side change in and out of ignored www" &&
121 svn log -v | fgrep "SVN-side change in and out of ignored www"
125 test_expect_success 'update git svn-cloned repo again (config ignore)' '
129 printf "test_qqq\nb\nygg\n" > expect &&
130 for i in */*.txt; do cat $i >> expect2; done &&
131 test_cmp expect2 expect &&
136 test_expect_success 'update git svn-cloned repo again (option ignore)' '
139 git svn rebase --ignore-paths="^www" &&
140 printf "test_qqq\nb\nygg\n" > expect &&
141 for i in */*.txt; do cat $i >> expect2; done &&
142 test_cmp expect2 expect &&