]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9155-git-svn-fetch-deleted-tag.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t9155-git-svn-fetch-deleted-tag.sh
CommitLineData
3235b705
DK
1#!/bin/sh
2
3test_description='git svn fetch deleted tag'
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/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 &&
17
5bc99d3f 18 svn_cmd mkdir -m "create mybranch directory" "$svnrepo/branches/mybranch" &&
3235b705
DK
19 svn_cmd cp -m "create branch mybranch" "$svnrepo/trunk" "$svnrepo/branches/mybranch/trunk" &&
20
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 &&
25
26 svn_cmd switch "$svnrepo/branches/mybranch/trunk" &&
27 echo "branch change" >>subdir/file &&
28 svn_cmd ci -m "branch change" subdir/file
29 ) &&
30
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"
34'
35
36test_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 &&
40
fe191fca 41 git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
a881baa2 42 git diff --exit-code main:subdir/file origin/tags/mytag^:file
3235b705
DK
43'
44
45test_done