]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9114-git-svn-dcommit-merge.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / t9114-git-svn-dcommit-merge.sh
CommitLineData
733a65aa
EW
1#!/bin/sh
2#
3# Copyright (c) 2007 Eric Wong
4# Based on a script by Joakim Tjernlund <joakim.tjernlund@transmode.se>
5
1364ff27 6test_description='git svn dcommit handles merges'
733a65aa
EW
7
8. ./lib-git-svn.sh
9
10big_text_block () {
11cat << EOF
12#
13# (C) Copyright 2000 - 2005
14# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
15#
16# See file CREDITS for list of people who contributed to this
17# project.
18#
19# This program is free software; you can redistribute it and/or
20# modify it under the terms of the GNU General Public License as
21# published by the Free Software Foundation; either version 2 of
22# the License, or (at your option) any later version.
23#
24# This program is distributed in the hope that it will be useful,
25# but WITHOUT ANY WARRANTY; without even the implied warranty of
26# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27# GNU General Public License for more details.
28#
29# You should have received a copy of the GNU General Public License
48425792 30# along with this program; if not, see <http://www.gnu.org/licenses/>.
733a65aa
EW
31#
32EOF
33}
34
f69e836f 35test_expect_success 'setup svn repository' '
da083d68 36 svn_cmd co "$svnrepo" mysvnwork &&
733a65aa 37 mkdir -p mysvnwork/trunk &&
18a82692
JN
38 (
39 cd mysvnwork &&
40 big_text_block >>trunk/README &&
da083d68 41 svn_cmd add trunk &&
fd4ec4f2 42 svn_cmd ci -m "first commit" trunk
18a82692 43 )
f69e836f 44 '
733a65aa 45
f69e836f
BD
46test_expect_success 'setup git mirror and merge' '
47 git svn init "$svnrepo" -t tags -T trunk -b branches &&
733a65aa 48 git svn fetch &&
fe191fca 49 git checkout -b svn remotes/origin/trunk &&
733a65aa
EW
50 git checkout -b merge &&
51 echo new file > new_file &&
52 git add new_file &&
f69e836f 53 git commit -a -m "New file" &&
733a65aa 54 echo hello >> README &&
f69e836f 55 git commit -a -m "hello" &&
733a65aa 56 echo add some stuff >> new_file &&
f69e836f 57 git commit -a -m "add some stuff" &&
733a65aa
EW
58 git checkout svn &&
59 mv -f README tmp &&
60 echo friend > README &&
61 cat tmp >> README &&
f69e836f 62 git commit -a -m "friend" &&
501a75a7 63 git merge merge
f69e836f 64 '
733a65aa
EW
65
66test_debug 'gitk --all & sleep 1'
67
68test_expect_success 'verify pre-merge ancestry' "
78ba28d8
EP
69 test x\$(git rev-parse --verify refs/heads/svn^2) = \
70 x\$(git rev-parse --verify refs/heads/merge) &&
a4d4e32a
PK
71 git cat-file commit refs/heads/svn^ >actual &&
72 grep '^friend$' actual
733a65aa
EW
73 "
74
75test_expect_success 'git svn dcommit merges' "
76 git svn dcommit
77 "
78
79test_debug 'gitk --all & sleep 1'
80
81test_expect_success 'verify post-merge ancestry' "
78ba28d8
EP
82 test x\$(git rev-parse --verify refs/heads/svn) = \
83 x\$(git rev-parse --verify refs/remotes/origin/trunk) &&
84 test x\$(git rev-parse --verify refs/heads/svn^2) = \
85 x\$(git rev-parse --verify refs/heads/merge) &&
a4d4e32a
PK
86 git cat-file commit refs/heads/svn^ >actual &&
87 grep '^friend$' actual
733a65aa
EW
88 "
89
fb159580 90test_expect_success 'verify merge commit message' "
a4d4e32a
PK
91 git rev-list --pretty=raw -1 refs/heads/svn >actual &&
92 grep \" Merge branch 'merge' into svn\" actual
fb159580
EW
93 "
94
733a65aa 95test_done