Merge branch 'ak/apply-non-git-epoch' into maint
[git] / t / t9157-git-svn-fetch-merge.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2010 Steven Walter
4 #
5
6 test_description='git svn merge detection'
7 . ./lib-git-svn.sh
8
9 test_expect_success 'initialize source svn repo' '
10         svn_cmd mkdir -m x "$svnrepo"/trunk &&
11         svn_cmd mkdir -m x "$svnrepo"/branches &&
12         svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
13         (
14                 cd "$SVN_TREE" &&
15                 touch foo &&
16                 svn add foo &&
17                 svn commit -m "initial commit" &&
18                 svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
19                 touch bar &&
20                 svn add bar &&
21                 svn commit -m x &&
22                 svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch2 &&
23                 svn switch "$svnrepo"/branches/branch1 &&
24                 touch baz &&
25                 svn add baz &&
26                 svn commit -m x &&
27                 svn switch "$svnrepo"/trunk &&
28                 svn merge "$svnrepo"/branches/branch1 &&
29                 svn commit -m "merge" &&
30                 svn switch "$svnrepo"/branches/branch1 &&
31                 svn commit -m x &&
32                 svn switch "$svnrepo"/branches/branch2 &&
33                 svn merge "$svnrepo"/branches/branch1 &&
34                 svn commit -m "merge branch1" &&
35                 svn switch "$svnrepo"/trunk &&
36                 svn merge "$svnrepo"/branches/branch2 &&
37                 svn resolved baz &&
38                 svn commit -m "merge branch2"
39         ) &&
40         rm -rf "$SVN_TREE"
41 '
42
43 test_expect_success 'clone svn repo' '
44         git svn init -s "$svnrepo" &&
45         git svn fetch
46 '
47
48 test_expect_success 'verify merge commit' 'git rev-parse HEAD^2'
49
50 test_done