3 # Copyright (c) 2007 Eric Wong
4 test_description='git svn dcommit clobber series'
7 test_expect_success 'initialize repo' '
10 awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file
11 svn import -m "initial" . "$svnrepo" &&
13 git svn init "$svnrepo" &&
18 test_expect_success '(supposedly) non-conflicting change from SVN' '
19 test x"`sed -n -e 58p < file`" = x58 &&
20 test x"`sed -n -e 61p < file`" = x61 &&
21 svn co "$svnrepo" tmp &&
23 perl -i.bak -p -e "s/^58$/5588/" file &&
24 perl -i.bak -p -e "s/^61$/6611/" file &&
26 test x"`sed -n -e 58p < file`" = x5588 &&
27 test x"`sed -n -e 61p < file`" = x6611 &&
28 svn commit -m "58 => 5588, 61 => 6611" &&
32 test_expect_success 'some unrelated changes to git' "
34 git update-index --add life &&
35 git commit -m hi-life &&
37 git commit -m bye-life life
40 test_expect_success 'change file but in unrelated area' "
41 test x\"\`sed -n -e 4p < file\`\" = x4 &&
42 test x\"\`sed -n -e 7p < file\`\" = x7 &&
43 perl -i.bak -p -e 's/^4\$/4444/' file &&
44 perl -i.bak -p -e 's/^7\$/7777/' file &&
45 test x\"\`sed -n -e 4p < file\`\" = x4444 &&
46 test x\"\`sed -n -e 7p < file\`\" = x7777 &&
47 git commit -m '4 => 4444, 7 => 7777' file &&
51 test x\"\`sed -n -e 4p < file\`\" = x4444 &&
52 test x\"\`sed -n -e 7p < file\`\" = x7777 &&
53 test x\"\`sed -n -e 58p < file\`\" = x5588 &&
54 test x\"\`sed -n -e 61p < file\`\" = x6611
57 test_expect_success 'attempt to dcommit with a dirty index' '
60 test_must_fail git svn dcommit