Merge branch 'ks/blame-worktree-textconv-cached'
[git] / t / t9010-svn-fe.sh
1 #!/bin/sh
2
3 test_description='check svn dumpfile importer'
4
5 . ./test-lib.sh
6
7 if ! svnadmin -h >/dev/null 2>&1
8 then
9         skip_all='skipping svn-fe tests, svn not available'
10         test_done
11 fi
12
13 svnconf=$PWD/svnconf
14 export svnconf
15
16 svn_cmd () {
17         subcommand=$1 &&
18         shift &&
19         mkdir -p "$svnconf" &&
20         svn "$subcommand" --config-dir "$svnconf" "$@"
21 }
22
23 test_dump () {
24         label=$1
25         dump=$2
26         test_expect_success "$dump" '
27                 svnadmin create "$label-svn" &&
28                 svnadmin load "$label-svn" < "$TEST_DIRECTORY/$dump" &&
29                 svn_cmd export "file://$PWD/$label-svn" "$label-svnco" &&
30                 git init "$label-git" &&
31                 test-svn-fe "$TEST_DIRECTORY/$dump" >"$label.fe" &&
32                 (
33                         cd "$label-git" &&
34                         git fast-import < ../"$label.fe"
35                 ) &&
36                 (
37                         cd "$label-svnco" &&
38                         git init &&
39                         git add . &&
40                         git fetch "../$label-git" master &&
41                         git diff --exit-code FETCH_HEAD
42                 )
43         '
44 }
45
46 test_dump simple t9135/svn.dump
47
48 test_done