2 test_description
='git-svn graft-branches'
5 svnrepo
="$svnrepo/test-git-svn"
7 test_expect_success
'initialize repo' "
10 mkdir -p trunk branches tags &&
11 echo hello > trunk/readme &&
12 svn import -m 'import for git-svn' . $svnrepo &&
14 svn cp -m 'tag a' $svnrepo/trunk $svnrepo/tags/a &&
15 svn cp -m 'branch a' $svnrepo/trunk $svnrepo/branches/a &&
18 echo feedme >> branches/a/readme &&
19 poke branches/a/readme &&
20 svn commit -m hungry &&
22 svn merge -r3:4 $svnrepo/branches/a &&
23 svn commit -m 'merge with a' &&
25 git-svn multi-init $svnrepo -T trunk -b branches -t tags &&
29 r1
=`git-rev-list remotes/trunk | tail -n1`
30 r2
=`git-rev-list remotes/tags/a | tail -n1`
31 r3
=`git-rev-list remotes/a | tail -n1`
32 r4
=`git-rev-parse remotes/a`
33 r5
=`git-rev-parse remotes/trunk`
35 test_expect_success
'test graft-branches regexes and copies' "
41 git-svn graft-branches &&
42 grep '^$r2 $r1' $GIT_DIR/info/grafts &&
43 grep '^$r3 $r1' $GIT_DIR/info/grafts &&
44 grep '^$r5 ' $GIT_DIR/info/grafts | grep '$r4' | grep '$r1'
47 test_debug
'gitk --all & sleep 1'
49 test_expect_success
'test graft-branches with tree-joins' "
50 rm $GIT_DIR/info/grafts &&
51 git-svn graft-branches --no-default-regex --no-graft-copy -B &&
52 grep '^$r3 ' $GIT_DIR/info/grafts | grep '$r1' | grep '$r2' &&
53 grep '^$r2 $r1' $GIT_DIR/info/grafts &&
54 grep '^$r5 ' $GIT_DIR/info/grafts | grep '$r1' | grep '$r4'
57 # the result of this is kinda funky, we have a strange history and
58 # this is just a test :)
59 test_debug
'gitk --all &'