3 # Copyright (c) 2008 Deskin Miller
6 test_description
='git svn partial-rebuild tests'
10 test_expect_success
'initialize svnrepo' '
14 mkdir trunk branches tags &&
18 svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null
21 svn_cmd co "$svnrepo"/trunk trunk &&
24 svn_cmd ci -m "updated trunk"
30 test_expect_success
'import into git' '
31 git svn init --stdlayout "$svnrepo" &&
33 git checkout remotes/origin/trunk
36 test_expect_success
'git svn branch tests' '
38 base=$(git rev-parse HEAD:) &&
39 test $base = $(git rev-parse remotes/origin/a:) &&
40 git svn branch -m "created branch b blah" b &&
41 test $base = $(git rev-parse remotes/origin/b:) &&
42 test_must_fail git branch -m "no branchname" &&
43 git svn branch -n c &&
44 test_must_fail git rev-parse remotes/origin/c &&
45 test_must_fail git svn branch a &&
46 git svn branch -t tag1 &&
47 test $base = $(git rev-parse remotes/origin/tags/tag1:) &&
48 git svn branch --tag tag2 &&
49 test $base = $(git rev-parse remotes/origin/tags/tag2:) &&
51 test $base = $(git rev-parse remotes/origin/tags/tag3:) &&
52 git svn tag -m "created tag4 foo" tag4 &&
53 test $base = $(git rev-parse remotes/origin/tags/tag4:) &&
54 test_must_fail git svn tag -m "no tagname" &&
55 git svn tag -n tag5 &&
56 test_must_fail git rev-parse remotes/origin/tags/tag5 &&
57 test_must_fail git svn tag tag1
60 test_expect_success
'branch uses correct svn-remote' '
61 (svn_cmd co "$svnrepo" svn &&
65 svn_cmd copy trunk mirror/ &&
66 svn_cmd copy tags mirror/ &&
67 svn_cmd copy branches mirror/ &&
68 svn_cmd ci -m "made mirror" ) &&
70 git svn init -s -R mirror --prefix=mirror/ "$svnrepo"/mirror &&
71 git svn fetch -R mirror &&
72 git checkout mirror/trunk &&
73 base=$(git rev-parse HEAD:) &&
74 git svn branch -m "branch in mirror" d &&
75 test $base = $(git rev-parse remotes/mirror/d:) &&
76 test_must_fail git rev-parse remotes/d