3 # Copyright (c) 2008 Deskin Miller
6 test_description
='git svn partial-rebuild tests'
8 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success
'initialize svnrepo' '
15 mkdir trunk branches tags &&
19 svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null
22 svn_cmd co "$svnrepo"/trunk trunk &&
25 svn_cmd ci -m "updated trunk"
31 test_expect_success
'import into git' '
32 git svn init --stdlayout "$svnrepo" &&
34 git checkout remotes/origin/trunk
37 test_expect_success
'git svn branch tests' '
39 base=$(git rev-parse HEAD:) &&
40 test $base = $(git rev-parse remotes/origin/a:) &&
41 git svn branch -m "created branch b blah" b &&
42 test $base = $(git rev-parse remotes/origin/b:) &&
43 test_must_fail git branch -m "no branchname" &&
44 git svn branch -n c &&
45 test_must_fail git rev-parse remotes/origin/c &&
46 test_must_fail git svn branch a &&
47 git svn branch -t tag1 &&
48 test $base = $(git rev-parse remotes/origin/tags/tag1:) &&
49 git svn branch --tag tag2 &&
50 test $base = $(git rev-parse remotes/origin/tags/tag2:) &&
52 test $base = $(git rev-parse remotes/origin/tags/tag3:) &&
53 git svn tag -m "created tag4 foo" tag4 &&
54 test $base = $(git rev-parse remotes/origin/tags/tag4:) &&
55 test_must_fail git svn tag -m "no tagname" &&
56 git svn tag -n tag5 &&
57 test_must_fail git rev-parse remotes/origin/tags/tag5 &&
58 test_must_fail git svn tag tag1
61 test_expect_success
'branch uses correct svn-remote' '
62 (svn_cmd co "$svnrepo" svn &&
66 svn_cmd copy trunk mirror/ &&
67 svn_cmd copy tags mirror/ &&
68 svn_cmd copy branches mirror/ &&
69 svn_cmd ci -m "made mirror" ) &&
71 git svn init -s -R mirror --prefix=mirror/ "$svnrepo"/mirror &&
72 git svn fetch -R mirror &&
73 git checkout mirror/trunk &&
74 base=$(git rev-parse HEAD:) &&
75 git svn branch -m "branch in mirror" d &&
76 test $base = $(git rev-parse remotes/mirror/d:) &&
77 test_must_fail git rev-parse remotes/d