3 # Copyright (c) 2006 Eric Wong
6 test_description
='git-svn --follow-parent fetching'
9 test_expect_success
'initialize repo' "
13 echo hello > trunk/readme &&
14 svn import -m 'initial' . $svnrepo &&
18 echo world >> trunk/readme &&
20 svn commit -m 'another commit' &&
22 svn mv -m 'rename to thunk' trunk thunk &&
24 echo goodbye >> thunk/readme &&
26 svn commit -m 'bye now' &&
30 test_expect_success
'init and fetch --follow-parent a moved directory' "
31 git-svn init -i thunk $svnrepo/thunk &&
32 git-svn fetch --follow-parent -i thunk &&
33 test \"\`git-rev-parse --verify refs/remotes/trunk\`\" \
34 = \"\`git-rev-parse --verify refs/remotes/thunk~1\`\" &&
35 test \"\`git-cat-file blob refs/remotes/thunk:readme |\
36 sed -n -e '3p'\`\" = goodbye
39 test_expect_success
'init and fetch from one svn-remote' "
40 git-repo-config svn-remote.git-svn.url $svnrepo &&
41 git-repo-config --add svn-remote.git-svn.fetch \
42 trunk:refs/remotes/svn/trunk &&
43 git-repo-config --add svn-remote.git-svn.fetch \
44 thunk:refs/remotes/svn/thunk &&
45 git-svn fetch --follow-parent -i svn/thunk &&
46 test \"\`git-rev-parse --verify refs/remotes/svn/trunk\`\" \
47 = \"\`git-rev-parse --verify refs/remotes/svn/thunk~1\`\" &&
48 test \"\`git-cat-file blob refs/remotes/svn/thunk:readme |\
49 sed -n -e '3p'\`\" = goodbye
52 test_expect_success
'follow deleted parent' "
53 svn cp -m 'resurrecting trunk as junk' \
54 -r2 $svnrepo/trunk $svnrepo/junk &&
55 git-repo-config --add svn-remote.git-svn.fetch \
56 junk:refs/remotes/svn/junk &&
57 git-svn fetch --follow-parent -i svn/thunk &&
58 git-svn fetch -i svn/junk --follow-parent &&
59 test -z \"\`git diff svn/junk svn/trunk\`\" &&
60 test \"\`git merge-base svn/junk svn/trunk\`\" \
61 = \"\`git rev-parse svn/trunk\`\"
64 test_debug
'gitk --all &'