t / t9155-git-svn-fetch-deleted-tag.shon commit Merge branch 'sb/submodule-embed-gitdir' (da2b74e)
   1#!/bin/sh
   2
   3test_description='git svn fetch deleted tag'
   4
   5. ./lib-git-svn.sh
   6
   7test_expect_success 'setup svn repo' '
   8        mkdir -p import/trunk/subdir &&
   9        mkdir -p import/branches &&
  10        mkdir -p import/tags &&
  11        echo "base" >import/trunk/subdir/file &&
  12        svn_cmd import -m "import for git svn" import "$svnrepo" &&
  13        rm -rf import &&
  14
  15        svn_cmd mkdir -m "create mybranch directory" "$svnrepo/branches/mybranch" &&
  16        svn_cmd cp -m "create branch mybranch" "$svnrepo/trunk" "$svnrepo/branches/mybranch/trunk" &&
  17
  18        svn_cmd co "$svnrepo/trunk" svn_project &&
  19        (cd svn_project &&
  20                echo "trunk change" >>subdir/file &&
  21                svn_cmd ci -m "trunk change" subdir/file &&
  22
  23                svn_cmd switch "$svnrepo/branches/mybranch/trunk" &&
  24                echo "branch change" >>subdir/file &&
  25                svn_cmd ci -m "branch change" subdir/file
  26        ) &&
  27
  28        svn_cmd cp -m "create mytag attempt 1" -r5 "$svnrepo/trunk/subdir" "$svnrepo/tags/mytag" &&
  29        svn_cmd rm -m "delete mytag attempt 1" "$svnrepo/tags/mytag" &&
  30        svn_cmd cp -m "create mytag attempt 2" -r5 "$svnrepo/branches/mybranch/trunk/subdir" "$svnrepo/tags/mytag"
  31'
  32
  33test_expect_success 'fetch deleted tags from same revision with checksum error' '
  34        git svn init --stdlayout "$svnrepo" git_project &&
  35        cd git_project &&
  36        git svn fetch &&
  37
  38        git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
  39        git diff --exit-code master:subdir/file origin/tags/mytag^:file
  40'
  41
  42test_done