1#!/bin/sh
2test_description='git svn handling of root commits in merge ranges'
3. ./lib-git-svn.sh
4
5svn_ver="$(svn --version --quiet)"
6case $svn_ver in
70.* | 1.[0-4].*)
8	skip_all="skipping git-svn test - SVN too old ($svn_ver)"
9	test_done
10	;;
11esac
12
13test_expect_success 'test handling of root commits in merge ranges' '
14	mkdir -p init/trunk init/branches init/tags &&
15	echo "r1" > init/trunk/file.txt &&
16	svn_cmd import -m "initial import" init "$svnrepo" &&
17	svn_cmd co "$svnrepo" tmp &&
18	(
19		cd tmp &&
20		echo "r2" > trunk/file.txt &&
21		svn_cmd commit -m "Modify file.txt on trunk" &&
22		svn_cmd cp trunk@1 branches/a &&
23		svn_cmd commit -m "Create branch a from trunk r1" &&
24		svn_cmd propset svn:mergeinfo /trunk:1-2 branches/a &&
25		svn_cmd commit -m "Fake merge of trunk r2 into branch a" &&
26		mkdir branches/b &&
27		echo "r5" > branches/b/file2.txt &&
28		svn_cmd add branches/b &&
29		svn_cmd commit -m "Create branch b from thin air" &&
30		echo "r6" > branches/b/file2.txt &&
31		svn_cmd commit -m "Modify file2.txt on branch b" &&
32		svn_cmd cp branches/b@5 branches/c &&
33		svn_cmd commit -m "Create branch c from branch b r5" &&
34		svn_cmd propset svn:mergeinfo /branches/b:5-6 branches/c &&
35		svn_cmd commit -m "Fake merge of branch b r6 into branch c"
36	) &&
37	git svn init -s "$svnrepo" &&
38	git svn fetch
39	'
40
41test_done
42