t / t9156-git-svn-fetch-deleted-tag-2.shon commit Merge branch 'jk/perf-aggregate-wo-libjson' (6cfa633)
   1#!/bin/sh
   2
   3test_description='git svn fetch deleted tag 2'
   4
   5. ./lib-git-svn.sh
   6
   7test_expect_success 'setup svn repo' '
   8        mkdir -p import/branches &&
   9        mkdir -p import/tags &&
  10        mkdir -p import/trunk/subdir1 &&
  11        mkdir -p import/trunk/subdir2 &&
  12        mkdir -p import/trunk/subdir3 &&
  13        echo "file1" >import/trunk/subdir1/file &&
  14        echo "file2" >import/trunk/subdir2/file &&
  15        echo "file3" >import/trunk/subdir3/file &&
  16        svn_cmd import -m "import for git svn" import "$svnrepo" &&
  17        rm -rf import &&
  18
  19        svn_cmd co "$svnrepo/trunk" svn_project &&
  20        (cd svn_project &&
  21                echo "change1" >>subdir1/file &&
  22                echo "change2" >>subdir2/file &&
  23                echo "change3" >>subdir3/file &&
  24                svn_cmd ci -m "change" .
  25        ) &&
  26
  27        svn_cmd cp -m "create mytag 1" -r2 "$svnrepo/trunk/subdir1" "$svnrepo/tags/mytag" &&
  28        svn_cmd rm -m "delete mytag 1" "$svnrepo/tags/mytag" &&
  29        svn_cmd cp -m "create mytag 2" -r2 "$svnrepo/trunk/subdir2" "$svnrepo/tags/mytag" &&
  30        svn_cmd rm -m "delete mytag 2" "$svnrepo/tags/mytag" &&
  31        svn_cmd cp -m "create mytag 3" -r2 "$svnrepo/trunk/subdir3" "$svnrepo/tags/mytag"
  32'
  33
  34test_expect_success 'fetch deleted tags from same revision with no checksum error' '
  35        git svn init --stdlayout "$svnrepo" git_project &&
  36        cd git_project &&
  37        git svn fetch &&
  38
  39        git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
  40        git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
  41        git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
  42'
  43
  44test_done