Tobias Schulte | f4f4c7f | 2013-05-15 22:14:43 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2013 Tobias Schulte |
| 4 | # |
| 5 | |
| 6 | test_description='git svn branch for subproject clones' |
Ævar Arnfjörð Bjarmason | 9081a42 | 2021-11-16 19:27:38 +0100 | [diff] [blame] | 7 | |
Tobias Schulte | f4f4c7f | 2013-05-15 22:14:43 +0200 | [diff] [blame] | 8 | . ./lib-git-svn.sh |
| 9 | |
| 10 | test_expect_success 'initialize svnrepo' ' |
| 11 | mkdir import && |
| 12 | ( |
| 13 | cd import && |
| 14 | mkdir -p trunk/project branches tags && |
| 15 | ( |
| 16 | cd trunk/project && |
| 17 | echo foo > foo |
| 18 | ) && |
| 19 | svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null |
| 20 | ) && |
| 21 | rm -rf import && |
| 22 | svn_cmd co "$svnrepo"/trunk/project trunk/project && |
| 23 | ( |
| 24 | cd trunk/project && |
| 25 | echo bar >> foo && |
| 26 | svn_cmd ci -m "updated trunk" |
| 27 | ) && |
| 28 | rm -rf trunk |
| 29 | ' |
| 30 | |
| 31 | test_expect_success 'import into git' ' |
| 32 | git svn init --trunk=trunk/project --branches=branches/*/project \ |
| 33 | --tags=tags/*/project "$svnrepo" && |
| 34 | git svn fetch && |
Johan Herland | fe191fc | 2013-10-11 14:57:07 +0200 | [diff] [blame] | 35 | git checkout remotes/origin/trunk |
Tobias Schulte | f4f4c7f | 2013-05-15 22:14:43 +0200 | [diff] [blame] | 36 | ' |
| 37 | |
| 38 | test_expect_success 'git svn branch tests' ' |
| 39 | test_must_fail git svn branch a && |
| 40 | git svn branch --parents a && |
| 41 | test_must_fail git svn branch -t tag1 && |
| 42 | git svn branch --parents -t tag1 && |
| 43 | test_must_fail git svn branch --tag tag2 && |
| 44 | git svn branch --parents --tag tag2 && |
| 45 | test_must_fail git svn tag tag3 && |
| 46 | git svn tag --parents tag3 |
| 47 | ' |
| 48 | |
| 49 | test_done |