Browse Source

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>
maint
Jonathan Nieder 15 years ago committed by Eric Wong
parent
commit
4ecb79386d
  1. 46
      t/t9118-git-svn-funky-branch-names.sh

46
t/t9118-git-svn-funky-branch-names.sh

@ -34,42 +34,46 @@ test_expect_success 'setup svnrepo' '


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


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


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


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


stop_httpd stop_httpd

Loading…
Cancel
Save