#!/bin/sh global test_description := ''git svn fetch deleted tag'' source ./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 master:subdir/file origin/tags/mytag^:file ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git svn fetch deleted tag">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./lib-git-svn.sh)}) (C {(test_expect_success)} {(SQ <"setup svn repo">)} { (SQ <"\n"> <"\tmkdir -p import/trunk/subdir &&\n"> <"\tmkdir -p import/branches &&\n"> <"\tmkdir -p import/tags &&\n"> <"\techo \"base\" >import/trunk/subdir/file &&\n"> <"\tsvn_cmd import -m \"import for git svn\" import \"$svnrepo\" &&\n"> <"\trm -rf import &&\n"> <"\n"> <"\tsvn_cmd mkdir -m \"create mybranch directory\" \"$svnrepo/branches/mybranch\" &&\n"> < "\tsvn_cmd cp -m \"create branch mybranch\" \"$svnrepo/trunk\" \"$svnrepo/branches/mybranch/trunk\" &&\n" > <"\n"> <"\tsvn_cmd co \"$svnrepo/trunk\" svn_project &&\n"> <"\t(cd svn_project &&\n"> <"\t\techo \"trunk change\" >>subdir/file &&\n"> <"\t\tsvn_cmd ci -m \"trunk change\" subdir/file &&\n"> <"\n"> <"\t\tsvn_cmd switch \"$svnrepo/branches/mybranch/trunk\" &&\n"> <"\t\techo \"branch change\" >>subdir/file &&\n"> <"\t\tsvn_cmd ci -m \"branch change\" subdir/file\n"> <"\t) &&\n"> <"\n"> < "\tsvn_cmd cp -m \"create mytag attempt 1\" -r5 \"$svnrepo/trunk/subdir\" \"$svnrepo/tags/mytag\" &&\n" > <"\tsvn_cmd rm -m \"delete mytag attempt 1\" \"$svnrepo/tags/mytag\" &&\n"> < "\tsvn_cmd cp -m \"create mytag attempt 2\" -r5 \"$svnrepo/branches/mybranch/trunk/subdir\" \"$svnrepo/tags/mytag\"\n" > ) } ) (C {(test_expect_success)} {(SQ <"fetch deleted tags from same revision with checksum error">)} { (SQ <"\n"> <"\tgit svn init --stdlayout \"$svnrepo\" git_project &&\n"> <"\tcd git_project &&\n"> <"\tgit svn fetch &&\n"> <"\n"> <"\tgit diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&\n"> <"\tgit diff --exit-code master:subdir/file origin/tags/mytag^:file\n"> ) } ) (C {(test_done)}) ] )