]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9137-git-svn-dcommit-clobber-series.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / t9137-git-svn-dcommit-clobber-series.sh
CommitLineData
c74d9acf
EW
1#!/bin/sh
2#
3# Copyright (c) 2007 Eric Wong
1364ff27 4test_description='git svn dcommit clobber series'
c74d9acf
EW
5. ./lib-git-svn.sh
6
f69e836f 7test_expect_success 'initialize repo' '
c74d9acf 8 mkdir import &&
fd4ec4f2 9 (cd import &&
cff4243d 10 awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file &&
fd4ec4f2
JL
11 svn_cmd import -m "initial" . "$svnrepo"
12 ) &&
f69e836f 13 git svn init "$svnrepo" &&
c74d9acf
EW
14 git svn fetch &&
15 test -e file
f69e836f 16 '
c74d9acf 17
f69e836f 18test_expect_success '(supposedly) non-conflicting change from SVN' '
2525c517
EP
19 test x"$(sed -n -e 58p < file)" = x58 &&
20 test x"$(sed -n -e 61p < file)" = x61 &&
da083d68 21 svn_cmd co "$svnrepo" tmp &&
fd4ec4f2 22 (cd tmp &&
94221d22
JK
23 perl -i.bak -p -e "s/^58$/5588/" file &&
24 perl -i.bak -p -e "s/^61$/6611/" file &&
8d92f248 25 poke file &&
2525c517
EP
26 test x"$(sed -n -e 58p < file)" = x5588 &&
27 test x"$(sed -n -e 61p < file)" = x6611 &&
fd4ec4f2
JL
28 svn_cmd commit -m "58 => 5588, 61 => 6611"
29 )
f69e836f 30 '
c74d9acf
EW
31
32test_expect_success 'some unrelated changes to git' "
33 echo hi > life &&
34 git update-index --add life &&
35 git commit -m hi-life &&
36 echo bye >> life &&
37 git commit -m bye-life life
38 "
39
40test_expect_success 'change file but in unrelated area' "
2525c517
EP
41 test x\"\$(sed -n -e 4p < file)\" = x4 &&
42 test x\"\$(sed -n -e 7p < file)\" = x7 &&
94221d22
JK
43 perl -i.bak -p -e 's/^4\$/4444/' file &&
44 perl -i.bak -p -e 's/^7\$/7777/' file &&
2525c517
EP
45 test x\"\$(sed -n -e 4p < file)\" = x4444 &&
46 test x\"\$(sed -n -e 7p < file)\" = x7777 &&
c74d9acf
EW
47 git commit -m '4 => 4444, 7 => 7777' file &&
48 git svn dcommit &&
da083d68 49 svn_cmd up tmp &&
c74d9acf 50 cd tmp &&
2525c517
EP
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
c74d9acf
EW
55 "
56
41ac414e 57test_expect_success 'attempt to dcommit with a dirty index' '
c8cfa3e4
BS
58 echo foo >>file &&
59 git add file &&
d492b31c 60 test_must_fail git svn dcommit
c8cfa3e4
BS
61'
62
c74d9acf 63test_done