]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9156-git-svn-fetch-deleted-tag-2.sh
The second batch
[thirdparty/git.git] / t / t9156-git-svn-fetch-deleted-tag-2.sh
CommitLineData
3235b705
DK
1#!/bin/sh
2
3test_description='git svn fetch deleted tag 2'
4
a881baa2 5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
3235b705
DK
8. ./lib-git-svn.sh
9
10test_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 &&
21
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 ) &&
29
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"
35'
36
37test_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 &&
41
a881baa2
JS
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
3235b705
DK
45'
46
47test_done