Skip to content

Commit

Permalink
t9118 (git-svn): prevent early failure from taking down later tests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Eric Wong committed Jul 8, 2010
1 parent 08fd28b commit 4ecb793
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions t/t9118-git-svn-funky-branch-names.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,46 @@ test_expect_success 'setup svnrepo' '

test_expect_success 'test clone with funky branch names' '
git svn clone -s "$svnrepo/pr ject" project &&
cd project &&
(
cd project &&
git rev-parse "refs/remotes/fun%20plugin" &&
git rev-parse "refs/remotes/more%20fun%20plugin!" &&
git rev-parse "refs/remotes/$scary_ref" &&
git rev-parse "refs/remotes/%2Eleading_dot" &&
git rev-parse "refs/remotes/trailing_dot%2E" &&
git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
git rev-parse "refs/remotes/not-a%40{0}reflog" &&
cd ..
git rev-parse "refs/remotes/not-a%40{0}reflog"
)
'

test_expect_success 'test dcommit to funky branch' "
cd project &&
git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
echo hello >> foo &&
git commit -m 'hello' -- foo &&
git svn dcommit &&
cd ..
(
cd project &&
git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
echo hello >> foo &&
git commit -m 'hello' -- foo &&
git svn dcommit
)
"

test_expect_success 'test dcommit to scary branch' '
cd project &&
git reset --hard "refs/remotes/$scary_ref" &&
echo urls are scary >> foo &&
git commit -m "eep" -- foo &&
git svn dcommit &&
cd ..
(
cd project &&
git reset --hard "refs/remotes/$scary_ref" &&
echo urls are scary >> foo &&
git commit -m "eep" -- foo &&
git svn dcommit
)
'

test_expect_success 'test dcommit to trailing_dotlock branch' '
cd project &&
git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
echo who names branches like this anyway? >> foo &&
git commit -m "bar" -- foo &&
git svn dcommit &&
cd ..
(
cd project &&
git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
echo who names branches like this anyway? >> foo &&
git commit -m "bar" -- foo &&
git svn dcommit
)
'

stop_httpd
Expand Down

0 comments on commit 4ecb793

Please sign in to comment.