Merge branch 'nd/index-pack-l10n-buf-overflow' into maint-1.8.1
[git/jnareb-git.git] / t / t9134-git-svn-ignore-paths.sh
blob09ff10cd9b0688522671cac9ee2c8886a8587947
1 #!/bin/sh
3 # Copyright (c) 2009 Vitaly Shukela
4 # Copyright (c) 2009 Eric Wong
7 test_description='git svn property tests'
8 . ./lib-git-svn.sh
10 test_expect_success 'setup test repository' '
11 svn_cmd co "$svnrepo" s &&
13 cd s &&
14 mkdir qqq www &&
15 echo test_qqq > qqq/test_qqq.txt &&
16 echo test_www > www/test_www.txt &&
17 svn_cmd add qqq &&
18 svn_cmd add www &&
19 svn_cmd commit -m "create some files" &&
20 svn_cmd up &&
21 echo hi >> www/test_www.txt &&
22 svn_cmd commit -m "modify www/test_www.txt" &&
23 svn_cmd up
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" ) &&
37 rm expect2 &&
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' '
45 cd g &&
46 git config --get svn-remote.svn.ignore-paths | fgrep "www"
50 test_expect_success 'SVN-side change outside of www' '
52 cd s &&
53 echo b >> qqq/test_qqq.txt &&
54 svn_cmd commit -m "SVN-side change outside of www" &&
55 svn_cmd up &&
56 svn_cmd log -v | fgrep "SVN-side change outside of www"
60 test_expect_success 'update git svn-cloned repo (config ignore)' '
62 cd g &&
63 git svn rebase &&
64 printf "test_qqq\nb\n" > expect &&
65 for i in */*.txt; do cat $i >> expect2; done &&
66 test_cmp expect2 expect &&
67 rm expect expect2
71 test_expect_success 'update git svn-cloned repo (option ignore)' '
73 cd c &&
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 &&
78 rm expect expect2
82 test_expect_success 'SVN-side change inside of ignored www' '
84 cd s &&
85 echo zaq >> www/test_www.txt
86 svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
87 svn_cmd up &&
88 svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
92 test_expect_success 'update git svn-cloned repo (config ignore)' '
94 cd g &&
95 git svn rebase &&
96 printf "test_qqq\nb\n" > expect &&
97 for i in */*.txt; do cat $i >> expect2; done &&
98 test_cmp expect2 expect &&
99 rm expect expect2
103 test_expect_success 'update git svn-cloned repo (option ignore)' '
105 cd c &&
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 &&
110 rm expect expect2
114 test_expect_success 'SVN-side change in and out of ignored www' '
116 cd s &&
117 echo cvf >> www/test_www.txt
118 echo ygg >> qqq/test_qqq.txt
119 svn_cmd commit -m "SVN-side change in and out of ignored www" &&
120 svn_cmd up &&
121 svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
125 test_expect_success 'update git svn-cloned repo again (config ignore)' '
127 cd g &&
128 git svn rebase &&
129 printf "test_qqq\nb\nygg\n" > expect &&
130 for i in */*.txt; do cat $i >> expect2; done &&
131 test_cmp expect2 expect &&
132 rm expect expect2
136 test_expect_success 'update git svn-cloned repo again (option ignore)' '
138 cd c &&
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 &&
143 rm expect expect2
147 test_done