t / t9131-git-svn-empty-symlink.shon commit t7610-mergetool: use test_cmp instead of test $(cat file) = $txt (e10dffd)
   1#!/bin/sh
   2
   3test_description='test that git handles an svn repository with empty symlinks'
   4
   5. ./lib-git-svn.sh
   6test_expect_success 'load svn dumpfile' '
   7        svnadmin load "$rawsvnrepo" <<EOF
   8SVN-fs-dump-format-version: 2
   9
  10UUID: 60780f9a-7df5-43b4-83ab-60e2c0673ef7
  11
  12Revision-number: 0
  13Prop-content-length: 56
  14Content-length: 56
  15
  16K 8
  17svn:date
  18V 27
  192008-11-26T07:17:27.590577Z
  20PROPS-END
  21
  22Revision-number: 1
  23Prop-content-length: 111
  24Content-length: 111
  25
  26K 7
  27svn:log
  28V 4
  29test
  30K 10
  31svn:author
  32V 12
  33normalperson
  34K 8
  35svn:date
  36V 27
  372008-11-26T07:18:03.511836Z
  38PROPS-END
  39
  40Node-path: bar
  41Node-kind: file
  42Node-action: add
  43Prop-content-length: 33
  44Text-content-length: 0
  45Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
  46Content-length: 33
  47
  48K 11
  49svn:special
  50V 1
  51*
  52PROPS-END
  53
  54Revision-number: 2
  55Prop-content-length: 121
  56Content-length: 121
  57
  58K 7
  59svn:log
  60V 13
  61bar => doink
  62
  63K 10
  64svn:author
  65V 12
  66normalperson
  67K 8
  68svn:date
  69V 27
  702008-11-27T03:55:31.601672Z
  71PROPS-END
  72
  73Node-path: bar
  74Node-kind: file
  75Node-action: change
  76Text-content-length: 10
  77Text-content-md5: 92ca4fe7a9721f877f765c252dcd66c9
  78Content-length: 10
  79
  80link doink
  81
  82EOF
  83'
  84
  85test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" x'
  86test_expect_success 'enable broken symlink workaround' \
  87  '(cd x && git config svn.brokenSymlinkWorkaround true)'
  88test_expect_success '"bar" is an empty file' 'test_must_be_empty x/bar'
  89test_expect_success 'get "bar" => symlink fix from svn' \
  90                '(cd x && git svn rebase)'
  91test_expect_success SYMLINKS '"bar" becomes a symlink' 'test -h x/bar'
  92
  93
  94test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" y'
  95test_expect_success 'disable broken symlink workaround' \
  96  '(cd y && git config svn.brokenSymlinkWorkaround false)'
  97test_expect_success '"bar" is an empty file' 'test_must_be_empty y/bar'
  98test_expect_success 'get "bar" => symlink fix from svn' \
  99                '(cd y && git svn rebase)'
 100test_expect_success '"bar" does not become a symlink' '! test -L y/bar'
 101
 102# svn.brokenSymlinkWorkaround is unset
 103test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" z'
 104test_expect_success '"bar" is an empty file' 'test_must_be_empty z/bar'
 105test_expect_success 'get "bar" => symlink fix from svn' \
 106                '(cd z && git svn rebase)'
 107test_expect_success '"bar" does not become a symlink' '! test -L z/bar'
 108
 109
 110test_done