Interested in helping open source friends on HP-UX?
[git/mjg.git] / t / t9157-git-svn-fetch-merge.sh
blob991d2aa1be63c2440db93e6237201383e28a498a
1 #!/bin/sh
3 # Copyright (c) 2010 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 add foo &&
25 svn commit -m "initial commit" &&
26 svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
27 touch bar &&
28 svn add bar &&
29 svn commit -m x &&
30 svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch2 &&
31 svn switch "$svnrepo"/branches/branch1 &&
32 touch baz &&
33 svn add baz &&
34 svn commit -m x &&
35 svn switch "$svnrepo"/trunk &&
36 svn merge "$svnrepo"/branches/branch1 &&
37 svn commit -m "merge" &&
38 svn switch "$svnrepo"/branches/branch1 &&
39 svn commit -m x &&
40 svn switch "$svnrepo"/branches/branch2 &&
41 svn merge "$svnrepo"/branches/branch1 &&
42 svn commit -m "merge branch1" &&
43 svn switch "$svnrepo"/trunk &&
44 svn merge "$svnrepo"/branches/branch2 &&
45 svn resolved baz &&
46 svn commit -m "merge branch2"
47 ) &&
48 rm -rf "$SVN_TREE"
51 test_expect_success 'clone svn repo' '
52 git svn init -s "$svnrepo" &&
53 git svn fetch
56 test_expect_success 'verify merge commit' 'git rev-parse HEAD^2'
58 test_done