3 # Copyright (c) 2012 Peter Baumann
6 test_description='git svn reset clears memoized caches'
9 svn_ver="$(svn --version --quiet)"
12 skip_all="skipping git-svn test - SVN too old ($svn_ver)"
17 # ... a - b - m <- trunk
21 # SVN Commits not interesting for this test are abbreviated with "..."
23 test_expect_success 'initialize source svn repo' '
24 svn_cmd mkdir -m "create trunk" "$svnrepo"/trunk &&
25 svn_cmd mkdir -m "create branches" "$svnrepo/branches" &&
26 svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
31 svn_cmd commit -m "a" &&
32 svn_cmd cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 &&
33 svn_cmd switch "$svnrepo"/branches/branch1 &&
36 svn_cmd commit -m b &&
37 svn_cmd switch "$svnrepo"/trunk &&
40 svn_cmd commit -m c &&
42 svn_cmd merge "$svnrepo"/branches/branch1 &&
48 test_expect_success 'fetch to merge-base (a)' '
49 git svn init -s "$svnrepo" &&
50 git svn fetch --revision BASE:3
53 # git svn rebase looses the merge commit
55 # ... a - b - m <- trunk
59 test_expect_success 'rebase looses SVN merge (m)' '
62 test 1 = $(git cat-file -p master|grep parent|wc -l)
65 # git svn fetch creates correct history with merge commit
67 # ... a - b - m <- trunk
71 test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '
73 git reset --hard origin/trunk &&
75 test 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)