| 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2008 Deskin Miller |
| 4 | # |
| 5 | |
| 6 | test_description='git svn partial-rebuild tests' |
| 7 | |
| 8 | . ./lib-git-svn.sh |
| 9 | |
| 10 | test_expect_success 'initialize svnrepo' ' |
| 11 | mkdir import && |
| 12 | ( |
| 13 | (cd import && |
| 14 | mkdir trunk branches tags && |
| 15 | (cd trunk && |
| 16 | echo foo > foo |
| 17 | ) && |
| 18 | svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null && |
| 19 | svn_cmd copy "$svnrepo"/trunk "$svnrepo"/branches/a \ |
| 20 | -m "created branch a" |
| 21 | ) && |
| 22 | rm -rf import && |
| 23 | svn_cmd co "$svnrepo"/trunk trunk && |
| 24 | (cd trunk && |
| 25 | echo bar >> foo && |
| 26 | svn_cmd ci -m "updated trunk" |
| 27 | ) && |
| 28 | svn_cmd co "$svnrepo"/branches/a a && |
| 29 | (cd a && |
| 30 | echo baz >> a && |
| 31 | svn_cmd add a && |
| 32 | svn_cmd ci -m "updated a" |
| 33 | ) && |
| 34 | git svn init --stdlayout "$svnrepo" |
| 35 | ) |
| 36 | ' |
| 37 | |
| 38 | test_expect_success 'import an early SVN revision into git' ' |
| 39 | git svn fetch -r1:2 |
| 40 | ' |
| 41 | |
| 42 | test_expect_success 'make full git mirror of SVN' ' |
| 43 | mkdir mirror && |
| 44 | ( |
| 45 | (cd mirror && |
| 46 | git init && |
| 47 | git svn init --stdlayout "$svnrepo" && |
| 48 | git svn fetch |
| 49 | ) |
| 50 | ) |
| 51 | ' |
| 52 | |
| 53 | test_expect_success 'fetch from git mirror and partial-rebuild' ' |
| 54 | git config --add remote.origin.url "file://$PWD/mirror/.git" && |
| 55 | git config --add remote.origin.fetch refs/remotes/*:refs/remotes/* && |
| 56 | git fetch origin && |
| 57 | git svn fetch |
| 58 | ' |
| 59 | |
| 60 | test_done |