t / t9010-svn-fe.shon commit Merge branch 'nd/extended-sha1-relpath' (620b89c)
   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
  23test_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
  46test_dump simple t9135/svn.dump
  47
  48test_done