@matheusbsbs / matheus-bagliano / commits / 4ecb79386d
Fork 0

t9118 (git-svn): prevent early failure from taking down later tests

When test #2 fails, the cwd is project/, causing all the remaining tests in the same script to get confused and fail. So in the spirit of v1.7.1.1~53^2~10 (t5550-http-fetch: Use subshell for repository operations, 2010-04-17), use a subshell for svn working copy operations. This way, the cwd will reliably return to the top of the trash directory and later tests can still be run when a command has failed. Reported-by: A Large Angry SCM <gitzilla@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>

Jonathan Nieder committed Jul 8, 2010 at 08:36 UTC 4ecb79386d2f45f3b439b397ac4aa592e1f4e9c8
1 file changed +25 -21
t/t9118-git-svn-funky-branch-names.sh
+25 -21
@@ -34,42 +34,46 @@ test_expect_success 'setup svnrepo' '
34
35 test_expect_success 'test clone with funky branch names' '
36 git svn clone -s "$svnrepo/pr ject" project &&
37 - cd project &&
37 + (
38 + cd project &&
39 git rev-parse "refs/remotes/fun%20plugin" &&
40 git rev-parse "refs/remotes/more%20fun%20plugin!" &&
41 git rev-parse "refs/remotes/$scary_ref" &&
42 git rev-parse "refs/remotes/%2Eleading_dot" &&
43 git rev-parse "refs/remotes/trailing_dot%2E" &&
44 git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
44 - git rev-parse "refs/remotes/not-a%40{0}reflog" &&
45 - cd ..
45 + git rev-parse "refs/remotes/not-a%40{0}reflog"
46 + )
47 '
48
49 test_expect_success 'test dcommit to funky branch' "
49 - cd project &&
50 - git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
51 - echo hello >> foo &&
52 - git commit -m 'hello' -- foo &&
53 - git svn dcommit &&
54 - cd ..
50 + (
51 + cd project &&
52 + git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
53 + echo hello >> foo &&
54 + git commit -m 'hello' -- foo &&
55 + git svn dcommit
56 + )
57 "
58
59 test_expect_success 'test dcommit to scary branch' '
58 - cd project &&
59 - git reset --hard "refs/remotes/$scary_ref" &&
60 - echo urls are scary >> foo &&
61 - git commit -m "eep" -- foo &&
62 - git svn dcommit &&
63 - cd ..
60 + (
61 + cd project &&
62 + git reset --hard "refs/remotes/$scary_ref" &&
63 + echo urls are scary >> foo &&
64 + git commit -m "eep" -- foo &&
65 + git svn dcommit
66 + )
67 '
68
69 test_expect_success 'test dcommit to trailing_dotlock branch' '
67 - cd project &&
68 - git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
69 - echo who names branches like this anyway? >> foo &&
70 - git commit -m "bar" -- foo &&
71 - git svn dcommit &&
72 - cd ..
70 + (
71 + cd project &&
72 + git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
73 + echo who names branches like this anyway? >> foo &&
74 + git commit -m "bar" -- foo &&
75 + git svn dcommit
76 + )
77 '
78
79 stop_httpd