3 # Copyright (c) 2006 Eric Wong
4 test_description
='git svn commit-diff clobber'
6 TEST_FAILS_SANITIZE_LEAK
=true
9 test_expect_success
'initialize repo' '
14 svn_cmd import -m "initial" . "$svnrepo"
16 echo initial > file &&
17 git update-index --add file &&
18 git commit -a -m "initial"
20 test_expect_success
'commit change from svn side' '
21 svn_cmd co "$svnrepo" t.svn &&
24 echo second line from svn >>file &&
26 svn_cmd commit -m "second line from svn"
31 test_expect_success
'commit conflicting change from git' '
32 echo second line from git >> file &&
33 git commit -a -m "second line from git" &&
34 test_must_fail git svn commit-diff -r1 HEAD~1 HEAD "$svnrepo"
37 test_expect_success
'commit complementing change from git' '
38 git reset --hard HEAD~1 &&
39 echo second line from svn >> file &&
40 git commit -a -m "second line from svn" &&
41 echo third line from git >> file &&
42 git commit -a -m "third line from git" &&
43 git svn commit-diff -r2 HEAD~1 HEAD "$svnrepo"
46 test_expect_success
'dcommit fails to commit because of conflict' '
47 git svn init "$svnrepo" &&
49 git reset --hard refs/remotes/git-svn &&
50 svn_cmd co "$svnrepo" t.svn &&
53 echo fourth line from svn >>file &&
55 svn_cmd commit -m "fourth line from svn"
58 echo "fourth line from git" >> file &&
59 git commit -a -m "fourth line from git" &&
60 test_must_fail git svn dcommit
63 test_expect_success
'dcommit does the svn equivalent of an index merge' "
64 git reset --hard refs/remotes/git-svn &&
65 echo 'index merge' > file2 &&
66 git update-index --add file2 &&
67 git commit -a -m 'index merge' &&
68 echo 'more changes' >> file2 &&
69 git update-index file2 &&
70 git commit -a -m 'more changes' &&
74 test_expect_success
'commit another change from svn side' '
75 svn_cmd co "$svnrepo" t.svn &&
78 echo third line from svn >>file &&
80 svn_cmd commit -m "third line from svn"
85 test_expect_success
'multiple dcommit from git svn will not clobber svn' "
86 git reset --hard refs/remotes/git-svn &&
87 echo new file >> new-file &&
88 git update-index --add new-file &&
89 git commit -a -m 'new file' &&
90 echo clobber > file &&
91 git commit -a -m 'clobber' &&
92 test_must_fail git svn dcommit
96 test_expect_success
'check that rebase really failed' '
98 grep currently.rebasing output
101 test_expect_success
'resolve, continue the rebase and dcommit' "
102 echo clobber and I really mean it > file &&
103 git update-index file &&
104 git rebase --continue &&