]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9127-git-svn-partial-rebuild.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t9127-git-svn-partial-rebuild.sh
CommitLineData
9747deb7
DM
1#!/bin/sh
2#
3# Copyright (c) 2008 Deskin Miller
4#
5
6test_description='git svn partial-rebuild tests'
7a98d9ab 7
9747deb7
DM
8. ./lib-git-svn.sh
9
10test_expect_success 'initialize svnrepo' '
11 mkdir import &&
12 (
fd4ec4f2 13 (cd import &&
9747deb7 14 mkdir trunk branches tags &&
fd4ec4f2
JL
15 (cd trunk &&
16 echo foo > foo
17 ) &&
da083d68
ER
18 svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null &&
19 svn_cmd copy "$svnrepo"/trunk "$svnrepo"/branches/a \
fd4ec4f2
JL
20 -m "created branch a"
21 ) &&
9747deb7 22 rm -rf import &&
da083d68 23 svn_cmd co "$svnrepo"/trunk trunk &&
fd4ec4f2 24 (cd trunk &&
9747deb7 25 echo bar >> foo &&
fd4ec4f2
JL
26 svn_cmd ci -m "updated trunk"
27 ) &&
da083d68 28 svn_cmd co "$svnrepo"/branches/a a &&
fd4ec4f2 29 (cd a &&
9747deb7 30 echo baz >> a &&
da083d68 31 svn_cmd add a &&
fd4ec4f2
JL
32 svn_cmd ci -m "updated a"
33 ) &&
9747deb7
DM
34 git svn init --stdlayout "$svnrepo"
35 )
36'
37
38test_expect_success 'import an early SVN revision into git' '
39 git svn fetch -r1:2
40'
41
42test_expect_success 'make full git mirror of SVN' '
43 mkdir mirror &&
44 (
fd4ec4f2 45 (cd mirror &&
9747deb7
DM
46 git init &&
47 git svn init --stdlayout "$svnrepo" &&
fd4ec4f2
JL
48 git svn fetch
49 )
9747deb7
DM
50 )
51'
52
2beec897 53test_expect_success 'fetch from git mirror and partial-rebuild' '
9747deb7
DM
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
60test_done