Interested in helping open source friends on HP-UX?
[git/mjg.git] / t / t9165-git-svn-fetch-merge-branch-of-branch.sh
blobfa3ef3b1f7408840cabc5eacb1b1851f1c8afaac
1 #!/bin/sh
3 # Copyright (c) 2012 Steven Walter
6 test_description='git svn merge detection'
7 . ./lib-git-svn.sh
9 svn_ver="$(svn --version --quiet)"
10 case $svn_ver in
11 0.* | 1.[0-4].*)
12 skip_all="skipping git-svn test - SVN too old ($svn_ver)"
13 test_done
15 esac
17 test_expect_success 'initialize source svn repo' '
18 svn_cmd mkdir -m x "$svnrepo"/trunk &&
19 svn_cmd mkdir -m x "$svnrepo"/branches &&
20 svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
22 cd "$SVN_TREE" &&
23 touch foo &&
24 svn_cmd add foo &&
25 svn_cmd commit -m "initial commit" &&
26 svn_cmd cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
27 svn_cmd switch "$svnrepo"/branches/branch1 &&
28 touch bar &&
29 svn_cmd add bar &&
30 svn_cmd commit -m branch1 &&
31 svn_cmd cp -m branch "$svnrepo"/branches/branch1 "$svnrepo"/branches/branch2 &&
32 svn_cmd switch "$svnrepo"/branches/branch2 &&
33 touch baz &&
34 svn_cmd add baz &&
35 svn_cmd commit -m branch2 &&
36 svn_cmd switch "$svnrepo"/trunk &&
37 touch bar2 &&
38 svn_cmd add bar2 &&
39 svn_cmd commit -m trunk &&
40 svn_cmd switch "$svnrepo"/branches/branch2 &&
41 svn_cmd merge "$svnrepo"/trunk &&
42 svn_cmd commit -m "merge trunk"
43 svn_cmd switch "$svnrepo"/trunk &&
44 svn_cmd merge --reintegrate "$svnrepo"/branches/branch2 &&
45 svn_cmd commit -m "merge branch2"
46 ) &&
47 rm -rf "$SVN_TREE"
50 test_expect_success 'clone svn repo' '
51 git svn init -s "$svnrepo" &&
52 git svn fetch
55 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
56 y=$(git rev-parse origin/branch2) &&
57 test "x$x" = "x$y"
60 test_done