Git 2.33.8
[git.git] / t / t9155-git-svn-fetch-deleted-tag.sh
blob3258374c137145c03e37f4d6763208eebc10faa6
1 #!/bin/sh
3 test_description='git svn fetch deleted tag'
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/trunk/subdir &&
12 mkdir -p import/branches &&
13 mkdir -p import/tags &&
14 echo "base" >import/trunk/subdir/file &&
15 svn_cmd import -m "import for git svn" import "$svnrepo" &&
16 rm -rf import &&
18 svn_cmd mkdir -m "create mybranch directory" "$svnrepo/branches/mybranch" &&
19 svn_cmd cp -m "create branch mybranch" "$svnrepo/trunk" "$svnrepo/branches/mybranch/trunk" &&
21 svn_cmd co "$svnrepo/trunk" svn_project &&
22 (cd svn_project &&
23 echo "trunk change" >>subdir/file &&
24 svn_cmd ci -m "trunk change" subdir/file &&
26 svn_cmd switch "$svnrepo/branches/mybranch/trunk" &&
27 echo "branch change" >>subdir/file &&
28 svn_cmd ci -m "branch change" subdir/file
29 ) &&
31 svn_cmd cp -m "create mytag attempt 1" -r5 "$svnrepo/trunk/subdir" "$svnrepo/tags/mytag" &&
32 svn_cmd rm -m "delete mytag attempt 1" "$svnrepo/tags/mytag" &&
33 svn_cmd cp -m "create mytag attempt 2" -r5 "$svnrepo/branches/mybranch/trunk/subdir" "$svnrepo/tags/mytag"
36 test_expect_success 'fetch deleted tags from same revision with checksum error' '
37 git svn init --stdlayout "$svnrepo" git_project &&
38 cd git_project &&
39 git svn fetch &&
41 git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
42 git diff --exit-code main:subdir/file origin/tags/mytag^:file
45 test_done