t / t9010-svn-fe.shon commit t0001,t1510,t3301: use sane_unset which always returns with status 0 (ed40ec5)
   1#!/bin/sh
   2
   3test_description='check svn dumpfile importer'
   4
   5. ./test-lib.sh
   6
   7if ! svnadmin -h >/dev/null 2>&1
   8then
   9        skip_all='skipping svn-fe tests, svn not available'
  10        test_done
  11fi
  12
  13svnconf=$PWD/svnconf
  14export svnconf
  15
  16svn_cmd () {
  17        subcommand=$1 &&
  18        shift &&
  19        mkdir -p "$svnconf" &&
  20        svn "$subcommand" --config-dir "$svnconf" "$@"
  21}
  22
  23reinit_git () {
  24        rm -fr .git &&
  25        git init
  26}
  27
  28>empty
  29
  30test_expect_success 'empty dump' '
  31        reinit_git &&
  32        echo "SVN-fs-dump-format-version: 2" >input &&
  33        test-svn-fe input >stream &&
  34        git fast-import <stream
  35'
  36
  37test_expect_success 'v3 dumps not supported' '
  38        reinit_git &&
  39        echo "SVN-fs-dump-format-version: 3" >input &&
  40        test_must_fail test-svn-fe input >stream &&
  41        test_cmp empty stream
  42'
  43
  44test_expect_success 't9135/svn.dump' '
  45        svnadmin create simple-svn &&
  46        svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
  47        svn_cmd export "file://$PWD/simple-svn" simple-svnco &&
  48        git init simple-git &&
  49        test-svn-fe "$TEST_DIRECTORY/t9135/svn.dump" >simple.fe &&
  50        (
  51                cd simple-git &&
  52                git fast-import <../simple.fe
  53        ) &&
  54        (
  55                cd simple-svnco &&
  56                git init &&
  57                git add . &&
  58                git fetch ../simple-git master &&
  59                git diff --exit-code FETCH_HEAD
  60        )
  61'
  62
  63test_done