diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t1450-fsck.sh | 4 | ||||
-rwxr-xr-x | t/t5400-send-pack.sh | 2 | ||||
-rwxr-xr-x | t/t5550-http-fetch.sh | 2 | ||||
-rwxr-xr-x | t/t5800-remote-helpers.sh | 2 | ||||
-rwxr-xr-x | t/t9118-git-svn-funky-branch-names.sh | 2 | ||||
-rwxr-xr-x | t/t9154-git-svn-fancy-glob.sh | 9 | ||||
-rwxr-xr-x | t/t9164-git-svn-dcommit-concurrent.sh (renamed from t/t9164-git-svn-dcommit-concrrent.sh) | 8 | ||||
-rwxr-xr-x | t/t9165-git-svn-fetch-merge-branch-of-branch.sh | 60 | ||||
-rwxr-xr-x | t/t9166-git-svn-fetch-merge-branch-of-branch2.sh | 53 | ||||
-rw-r--r-- | t/test-lib.sh | 2 |
10 files changed, 132 insertions, 12 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index bf7a2cd6fb..08aa24ca15 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -177,9 +177,7 @@ test_expect_success 'tag pointing to something else than its type' ' test_when_finished "remove_object $tag" && echo $tag >.git/refs/tags/wrong && test_when_finished "git update-ref -d refs/tags/wrong" && - test_must_fail git fsck --tags 2>out && - cat out && - grep "error in tag.*broken links" out + test_must_fail git fsck --tags ' test_expect_success 'cleaned up' ' diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 78ab177938..129fc88bd2 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -159,7 +159,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' ' git commit -a -m "Second commit" && git repack ) && - cp -a parent child && + cp -R parent child && ( # Set the child to auto-pack if more than one pack exists cd child && diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh index 16ef0419e9..80d20c876b 100755 --- a/t/t5550-http-fetch.sh +++ b/t/t5550-http-fetch.sh @@ -22,7 +22,7 @@ test_expect_success 'setup repository' ' ' test_expect_success 'create http-accessible bare repository with loose objects' ' - cp -a .git "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && + cp -R .git "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && git config core.bare true && mkdir -p hooks && diff --git a/t/t5800-remote-helpers.sh b/t/t5800-remote-helpers.sh index 5702334510..e7dc668cef 100755 --- a/t/t5800-remote-helpers.sh +++ b/t/t5800-remote-helpers.sh @@ -76,7 +76,7 @@ test_expect_success 'pushing to local repo' ' # git-remote-testgit, but is too slow to leave in for general use. : test_expect_success 'racily pushing to local repo' ' test_when_finished "rm -rf server2 localclone2" && - cp -a server server2 && + cp -R server server2 && git clone "testgit::${PWD}/server2" localclone2 && (cd localclone2 && echo content >>file && diff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh index 193d3cabdd..15f93b4c28 100755 --- a/t/t9118-git-svn-funky-branch-names.sh +++ b/t/t9118-git-svn-funky-branch-names.sh @@ -28,7 +28,7 @@ test_expect_success 'setup svnrepo' ' svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \ "$svnrepo/pr ject/branches/trailing_dotlock.lock" && svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \ - "$svnrepo/pr ject/branches/not-a%40{0}reflog" && + "$svnrepo/pr ject/branches/not-a@{0}reflog@" && start_httpd ' diff --git a/t/t9154-git-svn-fancy-glob.sh b/t/t9154-git-svn-fancy-glob.sh index a6a56a6cb9..b780e0efe3 100755 --- a/t/t9154-git-svn-fancy-glob.sh +++ b/t/t9154-git-svn-fancy-glob.sh @@ -21,6 +21,15 @@ test_expect_success 'add red branch' " test_must_fail git rev-parse refs/remotes/blue " +test_expect_success 'add gre branch' " + GIT_CONFIG=.git/svn/.metadata git config --unset svn-remote.svn.branches-maxRev && + git config svn-remote.svn.branches 'branches/{red,gre}:refs/remotes/*' && + git svn fetch && + git rev-parse refs/remotes/red && + test_must_fail git rev-parse refs/remotes/green && + test_must_fail git rev-parse refs/remotes/blue + " + test_expect_success 'add green branch' " GIT_CONFIG=.git/svn/.metadata git config --unset svn-remote.svn.branches-maxRev && git config svn-remote.svn.branches 'branches/{red,green}:refs/remotes/*' && diff --git a/t/t9164-git-svn-dcommit-concrrent.sh b/t/t9164-git-svn-dcommit-concurrent.sh index aac2ddadf2..d8464d4218 100755 --- a/t/t9164-git-svn-dcommit-concrrent.sh +++ b/t/t9164-git-svn-dcommit-concurrent.sh @@ -60,11 +60,11 @@ setup_hook() [ "$cnt" = "0" ] || exit 0 EOF1 if [ "$hook_type" = "pre-commit" ]; then - echo "echo 'commit disallowed' >&2; exit 1" >> "$hook" + echo "echo 'commit disallowed' >&2; exit 1" >>"$hook" else - echo "PATH=\"$PATH\"; export PATH" >> $hook - echo "svnconf=\"$svnconf\"" >> $hook - cat >> "$hook" <<- 'EOF2' + echo "PATH=\"$PATH\"; export PATH" >>"$hook" + echo "svnconf=\"$svnconf\"" >>"$hook" + cat >>"$hook" <<- 'EOF2' cd work-auto-commits.svn svn up --config-dir "$svnconf" echo "$$" >> auto_updated_file diff --git a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh new file mode 100755 index 0000000000..13ae7e33f9 --- /dev/null +++ b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Copyright (c) 2012 Steven Walter +# + +test_description='git svn merge detection' +. ./lib-git-svn.sh + +svn_ver="$(svn --version --quiet)" +case $svn_ver in +0.* | 1.[0-4].*) + skip_all="skipping git-svn test - SVN too old ($svn_ver)" + test_done + ;; +esac + +test_expect_success 'initialize source svn repo' ' + svn_cmd mkdir -m x "$svnrepo"/trunk && + svn_cmd mkdir -m x "$svnrepo"/branches && + svn_cmd co "$svnrepo"/trunk "$SVN_TREE" && + ( + cd "$SVN_TREE" && + touch foo && + svn_cmd add foo && + svn_cmd commit -m "initial commit" && + svn_cmd cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 && + svn_cmd switch "$svnrepo"/branches/branch1 && + touch bar && + svn_cmd add bar && + svn_cmd commit -m branch1 && + svn_cmd cp -m branch "$svnrepo"/branches/branch1 "$svnrepo"/branches/branch2 && + svn_cmd switch "$svnrepo"/branches/branch2 && + touch baz && + svn_cmd add baz && + svn_cmd commit -m branch2 && + svn_cmd switch "$svnrepo"/trunk && + touch bar2 && + svn_cmd add bar2 && + svn_cmd commit -m trunk && + svn_cmd switch "$svnrepo"/branches/branch2 && + svn_cmd merge "$svnrepo"/trunk && + svn_cmd commit -m "merge trunk" + svn_cmd switch "$svnrepo"/trunk && + svn_cmd merge --reintegrate "$svnrepo"/branches/branch2 && + svn_cmd commit -m "merge branch2" + ) && + rm -rf "$SVN_TREE" +' + +test_expect_success 'clone svn repo' ' + git svn init -s "$svnrepo" && + git svn fetch +' + +test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) && + y=$(git rev-parse branch2) && + test "x$x" = "x$y" +' + +test_done diff --git a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh new file mode 100755 index 0000000000..af0ec0e2e3 --- /dev/null +++ b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Copyright (c) 2012 Steven Walter +# + +test_description='git svn merge detection' +. ./lib-git-svn.sh + +svn_ver="$(svn --version --quiet)" +case $svn_ver in +0.* | 1.[0-4].*) + skip_all="skipping git-svn test - SVN too old ($svn_ver)" + test_done + ;; +esac + +test_expect_success 'initialize source svn repo' ' + svn_cmd mkdir -m x "$svnrepo"/trunk && + svn_cmd mkdir -m x "$svnrepo"/branches && + svn_cmd co "$svnrepo"/trunk "$SVN_TREE" && + ( + cd "$SVN_TREE" && + touch foo && + svn_cmd add foo && + svn_cmd commit -m "initial commit" && + svn_cmd cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 && + svn_cmd switch "$svnrepo"/branches/branch1 && + touch bar && + svn_cmd add bar && + svn_cmd commit -m branch1 && + svn_cmd cp -m branch "$svnrepo"/branches/branch1 "$svnrepo"/branches/branch2 && + svn_cmd switch "$svnrepo"/branches/branch2 && + touch baz && + svn_cmd add baz && + svn_cmd commit -m branch2 && + svn_cmd switch "$svnrepo"/trunk && + svn_cmd merge --reintegrate "$svnrepo"/branches/branch2 && + svn_cmd commit -m "merge branch2" + ) && + rm -rf "$SVN_TREE" +' + +test_expect_success 'clone svn repo' ' + git svn init -s "$svnrepo" && + git svn fetch +' + +test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) && + y=$(git rev-parse branch2) && + test "x$x" = "x$y" +' + +test_done diff --git a/t/test-lib.sh b/t/test-lib.sh index 514282cbdf..489bc80fc1 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -230,7 +230,7 @@ else say_color() { test -z "$1" && test -n "$quiet" && return shift - echo "$*" + printf "%s\n" "$*" } fi |