git-commit-vandalism/t/t9155-git-svn-fetch-deleted-tag.sh
Johannes Schindelin a881baa2c3 t9[0-4]*: adjust the references to the default branch name "main"
This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[0-4]*.sh)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-19 15:44:18 -08:00

46 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
test_description='git svn fetch deleted tag'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./lib-git-svn.sh
test_expect_success 'setup svn repo' '
mkdir -p import/trunk/subdir &&
mkdir -p import/branches &&
mkdir -p import/tags &&
echo "base" >import/trunk/subdir/file &&
svn_cmd import -m "import for git svn" import "$svnrepo" &&
rm -rf import &&
svn_cmd mkdir -m "create mybranch directory" "$svnrepo/branches/mybranch" &&
svn_cmd cp -m "create branch mybranch" "$svnrepo/trunk" "$svnrepo/branches/mybranch/trunk" &&
svn_cmd co "$svnrepo/trunk" svn_project &&
(cd svn_project &&
echo "trunk change" >>subdir/file &&
svn_cmd ci -m "trunk change" subdir/file &&
svn_cmd switch "$svnrepo/branches/mybranch/trunk" &&
echo "branch change" >>subdir/file &&
svn_cmd ci -m "branch change" subdir/file
) &&
svn_cmd cp -m "create mytag attempt 1" -r5 "$svnrepo/trunk/subdir" "$svnrepo/tags/mytag" &&
svn_cmd rm -m "delete mytag attempt 1" "$svnrepo/tags/mytag" &&
svn_cmd cp -m "create mytag attempt 2" -r5 "$svnrepo/branches/mybranch/trunk/subdir" "$svnrepo/tags/mytag"
'
test_expect_success 'fetch deleted tags from same revision with checksum error' '
git svn init --stdlayout "$svnrepo" git_project &&
cd git_project &&
git svn fetch &&
git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
git diff --exit-code main:subdir/file origin/tags/mytag^:file
'
test_done