Merge branch 'ps/reflog-list' into HEAD
[alt-git.git] / t / t9156-git-svn-fetch-deleted-tag-2.sh
blob2b75c403e3f476c79afd6de4b8e26f217201f0c7
1 #!/bin/sh
3 test_description='git svn fetch deleted tag 2'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 . ./lib-git-svn.sh
10 test_expect_success 'setup svn repo' '
11 mkdir -p import/branches &&
12 mkdir -p import/tags &&
13 mkdir -p import/trunk/subdir1 &&
14 mkdir -p import/trunk/subdir2 &&
15 mkdir -p import/trunk/subdir3 &&
16 echo "file1" >import/trunk/subdir1/file &&
17 echo "file2" >import/trunk/subdir2/file &&
18 echo "file3" >import/trunk/subdir3/file &&
19 svn_cmd import -m "import for git svn" import "$svnrepo" &&
20 rm -rf import &&
22 svn_cmd co "$svnrepo/trunk" svn_project &&
23 (cd svn_project &&
24 echo "change1" >>subdir1/file &&
25 echo "change2" >>subdir2/file &&
26 echo "change3" >>subdir3/file &&
27 svn_cmd ci -m "change" .
28 ) &&
30 svn_cmd cp -m "create mytag 1" -r2 "$svnrepo/trunk/subdir1" "$svnrepo/tags/mytag" &&
31 svn_cmd rm -m "delete mytag 1" "$svnrepo/tags/mytag" &&
32 svn_cmd cp -m "create mytag 2" -r2 "$svnrepo/trunk/subdir2" "$svnrepo/tags/mytag" &&
33 svn_cmd rm -m "delete mytag 2" "$svnrepo/tags/mytag" &&
34 svn_cmd cp -m "create mytag 3" -r2 "$svnrepo/trunk/subdir3" "$svnrepo/tags/mytag"
37 test_expect_success 'fetch deleted tags from same revision with no checksum error' '
38 git svn init --stdlayout "$svnrepo" git_project &&
39 cd git_project &&
40 git svn fetch &&
42 git diff --exit-code main:subdir3/file origin/tags/mytag:file &&
43 git diff --exit-code main:subdir2/file origin/tags/mytag^:file &&
44 git diff --exit-code main:subdir1/file origin/tags/mytag^^:file
47 test_done