t / t9010-svn-fe.shon commit Merge branch 'jl/fetch-submodule-recursive' into maint (597a630)
   1#!/bin/sh
   2
   3test_description='check svn dumpfile importer'
   4
   5. ./test-lib.sh
   6
   7reinit_git () {
   8        rm -fr .git &&
   9        git init
  10}
  11
  12>empty
  13
  14test_expect_success 'empty dump' '
  15        reinit_git &&
  16        echo "SVN-fs-dump-format-version: 2" >input &&
  17        test-svn-fe input >stream &&
  18        git fast-import <stream
  19'
  20
  21test_expect_success 'v3 dumps not supported' '
  22        reinit_git &&
  23        echo "SVN-fs-dump-format-version: 3" >input &&
  24        test_must_fail test-svn-fe input >stream &&
  25        test_cmp empty stream
  26'
  27
  28test_expect_success 'set up svn repo' '
  29        svnconf=$PWD/svnconf &&
  30        mkdir -p "$svnconf" &&
  31
  32        if
  33                svnadmin -h >/dev/null 2>&1 &&
  34                svnadmin create simple-svn &&
  35                svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
  36                svn export --config-dir "$svnconf" "file://$PWD/simple-svn" simple-svnco
  37        then
  38                test_set_prereq SVNREPO
  39        fi
  40'
  41
  42test_expect_success SVNREPO 't9135/svn.dump' '
  43        git init simple-git &&
  44        test-svn-fe "$TEST_DIRECTORY/t9135/svn.dump" >simple.fe &&
  45        (
  46                cd simple-git &&
  47                git fast-import <../simple.fe
  48        ) &&
  49        (
  50                cd simple-svnco &&
  51                git init &&
  52                git add . &&
  53                git fetch ../simple-git master &&
  54                git diff --exit-code FETCH_HEAD
  55        )
  56'
  57
  58test_done