Skip to content

Commit 242522d

Browse files
Vitaly \"_Vi\" ShukelaEric Wong
authored andcommitted
git-svn: Add test for --ignore-paths parameter
Added a test for this option, similar to (and based on) t9133 about ignorance of .git directories Signed-off-by: Vitaly "_Vi" Shukela <[email protected]> Acked-by: Eric Wong <[email protected]> [ew: replaced 'echo -e' with printf so it works on POSIX shells] [ew: added Vitaly to copyright even though it's based on my test]
1 parent 6076b84 commit 242522d

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

t/t9134-git-svn-ignore-paths.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2009 Vitaly Shukela
4+
# Copyright (c) 2009 Eric Wong
5+
#
6+
7+
test_description='git svn property tests'
8+
. ./lib-git-svn.sh
9+
10+
test_expect_success 'setup test repository' '
11+
svn co "$svnrepo" s &&
12+
(
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 add qqq &&
18+
svn add www &&
19+
svn commit -m "create some files" &&
20+
svn up &&
21+
echo hi >> www/test_www.txt &&
22+
svn commit -m "modify www/test_www.txt" &&
23+
svn up
24+
)
25+
'
26+
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
32+
'
33+
34+
test_expect_success 'SVN-side change outside of www' '
35+
(
36+
cd s &&
37+
echo b >> qqq/test_qqq.txt &&
38+
svn commit -m "SVN-side change outside of www" &&
39+
svn up &&
40+
svn log -v | fgrep "SVN-side change outside of www"
41+
)
42+
'
43+
44+
test_expect_success 'update git svn-cloned repo' '
45+
(
46+
cd g &&
47+
git svn rebase --ignore-paths="^www" &&
48+
printf "test_qqq\nb\n" > expect &&
49+
for i in */*.txt; do cat $i >> expect2; done &&
50+
test_cmp expect2 expect &&
51+
rm expect expect2
52+
)
53+
'
54+
55+
test_expect_success 'SVN-side change inside of ignored www' '
56+
(
57+
cd s &&
58+
echo zaq >> www/test_www.txt
59+
svn commit -m "SVN-side change inside of www/test_www.txt" &&
60+
svn up &&
61+
svn log -v | fgrep "SVN-side change inside of www/test_www.txt"
62+
)
63+
'
64+
65+
test_expect_success 'update git svn-cloned repo' '
66+
(
67+
cd g &&
68+
git svn rebase --ignore-paths="^www" &&
69+
printf "test_qqq\nb\n" > expect &&
70+
for i in */*.txt; do cat $i >> expect2; done &&
71+
test_cmp expect2 expect &&
72+
rm expect expect2
73+
)
74+
'
75+
76+
test_expect_success 'SVN-side change in and out of ignored www' '
77+
(
78+
cd s &&
79+
echo cvf >> www/test_www.txt
80+
echo ygg >> qqq/test_qqq.txt
81+
svn commit -m "SVN-side change in and out of ignored www" &&
82+
svn up &&
83+
svn log -v | fgrep "SVN-side change in and out of ignored www"
84+
)
85+
'
86+
87+
test_expect_success 'update git svn-cloned repo again' '
88+
(
89+
cd g &&
90+
git svn rebase --ignore-paths="^www" &&
91+
printf "test_qqq\nb\nygg\n" > expect &&
92+
for i in */*.txt; do cat $i >> expect2; done &&
93+
test_cmp expect2 expect &&
94+
rm expect expect2
95+
)
96+
'
97+
98+
test_done

0 commit comments

Comments
 (0)