3 # Copyright (c) 2006 Eric Wong
4 test_description
='git-svn commit-diff clobber'
7 if test -n "$GIT_SVN_NO_LIB" && test "$GIT_SVN_NO_LIB" -ne 0
9 echo 'Skipping: commit-diff clobber needs SVN libraries'
14 test_expect_success
'initialize repo' "
17 echo initial > file &&
18 svn import -m 'initial' . $svnrepo &&
20 echo initial > file &&
21 git update-index --add file &&
22 git commit -a -m 'initial'
24 test_expect_success
'commit change from svn side' "
25 svn co $svnrepo t.svn &&
27 echo second line from svn >> file &&
28 svn commit -m 'second line from svn' &&
33 test_expect_failure
'commit conflicting change from git' "
34 echo second line from git >> file &&
35 git commit -a -m 'second line from git' &&
36 git-svn commit-diff -r1 HEAD~1 HEAD $svnrepo
39 test_expect_success
'commit complementing change from git' "
40 git reset --hard HEAD~1 &&
41 echo second line from svn >> file &&
42 git commit -a -m 'second line from svn' &&
43 echo third line from git >> file &&
44 git commit -a -m 'third line from git' &&
45 git-svn commit-diff -r2 HEAD~1 HEAD $svnrepo
48 test_expect_failure
'dcommit fails to commit because of conflict' "
49 git-svn init $svnrepo &&
51 git reset --hard refs/remotes/git-svn &&
52 svn co $svnrepo t.svn &&
54 echo fourth line from svn >> file &&
55 svn commit -m 'fourth line from svn' &&
58 echo 'fourth line from git' >> file &&
59 git commit -a -m 'fourth line from git' &&
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' &&