3 # Copyright (c) 2006 Eric Wong
4 test_description
='git-svn commit-diff clobber'
7 test_expect_success
'initialize repo' "
10 echo initial > file &&
11 svn import -m 'initial' . $svnrepo &&
13 echo initial > file &&
14 git update-index --add file &&
15 git commit -a -m 'initial'
17 test_expect_success
'commit change from svn side' "
18 svn co $svnrepo t.svn &&
20 echo second line from svn >> file &&
21 svn commit -m 'second line from svn' &&
26 test_expect_failure
'commit conflicting change from git' "
27 echo second line from git >> file &&
28 git commit -a -m 'second line from git' &&
29 git-svn commit-diff -r1 HEAD~1 HEAD $svnrepo
32 test_expect_success
'commit complementing change from git' "
33 git reset --hard HEAD~1 &&
34 echo second line from svn >> file &&
35 git commit -a -m 'second line from svn' &&
36 echo third line from git >> file &&
37 git commit -a -m 'third line from git' &&
38 git-svn commit-diff -r2 HEAD~1 HEAD $svnrepo
41 test_expect_failure
'dcommit fails to commit because of conflict' "
42 git-svn init $svnrepo &&
44 git reset --hard refs/remotes/git-svn &&
45 svn co $svnrepo t.svn &&
47 echo fourth line from svn >> file &&
48 svn commit -m 'fourth line from svn' &&
51 echo 'fourth line from git' >> file &&
52 git commit -a -m 'fourth line from git' &&
56 test_expect_success
'dcommit does the svn equivalent of an index merge' "
57 git reset --hard refs/remotes/git-svn &&
58 echo 'index merge' > file2 &&
59 git update-index --add file2 &&
60 git commit -a -m 'index merge' &&
61 echo 'more changes' >> file2 &&
62 git update-index file2 &&
63 git commit -a -m 'more changes' &&