env GO111MODULE=on
-env GOPROXY=
-
-# TODO(jayconrod): get test repo onto vcs-test.golang.org
+env GOPROXY=direct
+env GOSUMDB=off
# Testing that a pseudo-version is based on the semantically-latest
# tag that appears in any commit that is a (transitive) parent of the commit
# For this test repository:
# tag v0.2.1 is most recent tag on master itself
# tag v0.2.2 is on branch2, which was then merged to master
-# commit 5aaa858 is on master at a later point
+# master is a merge commit with both tags as parents
#
# The pseudo-version hence sorts immediately after v0.2.2 rather
# than v0.2.1, even though the v0.2.2 tag is not on master.
-go get -m github.com/leitzler/tagtests@5aaa858
+
+go get -m vcs-test.golang.org/git/tagtests.git@master
go list -m all
-stdout '^github.com/leitzler/tagtests v0.2.3-0.20190424071028-5aaa858a59e2$'
+stdout '^vcs-test.golang.org/git/tagtests.git v0.2.3-0\.'
-- go.mod --
module x
-- x.go --
package x
-import _ "github.com/leitzler/tagtests"
+import _ "vcs-test.golang.org/git/tagtests.git"
+-- gen_testtags.sh --
+#!/bin/bash
+
+# This is not part of the test.
+# Run this to generate and update the repository on vcs-test.golang.org.
+
+set -euo pipefail
+cd "$(dirname "$0")"
+rm -rf tagtests
+mkdir tagtests
+cd tagtests
+
+git init
+echo module vcs-test.golang.org/git/tagtests.git >go.mod
+echo package tagtests >tagtests.go
+git add go.mod tagtests.go
+git commit -m 'create module tagtests'
+
+git branch b
+
+echo v0.2.1 >v0.2.1
+git add v0.2.1
+git commit -m v0.2.1
+git tag v0.2.1
+
+git checkout b
+echo v0.2.2 >v0.2.2
+git add v0.2.2
+git commit -m v0.2.2
+git tag v0.2.2
+
+git checkout master
+git merge b -m merge
+
+zip -r ../tagtests.zip .
+gsutil cp ../tagtests.zip gs://vcs-test/git/tagtests.zip
env GO111MODULE=on
-env GOPROXY=
-
-# TODO(jayconrod): get test repo onto vcs-test.golang.org
+env GOPROXY=direct
+env GOSUMDB=off
# Testing that a pseudo-version is based on the semantically-latest
# prefixed tag in any commit that is a parent of the commit supplied
[!exec:git] skip
# For this test repository go.mod resides in sub/ (only):
-# master (372cb6e) is not tagged
+# master is not tagged
# tag v0.2.0 is most recent tag before master
# tag sub/v0.0.10 is most recent tag before v0.2.0
#
# The pseudo-version is based on sub/v0.0.10, since v0.2.0 doesn't
# contain the prefix.
-go get -m github.com/leitzler/prefixtagtests/sub
+go get -m vcs-test.golang.org/git/prefixtagtests.git/sub
go list -m all
-stdout '^github.com/leitzler/prefixtagtests/sub v0.0.10$'
+stdout '^vcs-test.golang.org/git/prefixtagtests.git/sub v0.0.10$'
-go get -u -m github.com/leitzler/prefixtagtests/sub@372cb6e
+go get -u -m vcs-test.golang.org/git/prefixtagtests.git/sub@master
go list -m all
-stdout '^github.com/leitzler/prefixtagtests/sub v0.0.11-0.20190427183112-372cb6ea3fb5$'
+stdout '^vcs-test.golang.org/git/prefixtagtests.git/sub v0.0.11-0\.'
-- go.mod --
module x
-- x.go --
package x
-import _ "github.com/leitzler/prefixtagtests/sub"
+import _ "vcs-test.golang.org/prefixtagtests.git/sub"
+-- gen_prefixtagtests.sh --
+#!/bin/bash
+
+# This is not part of the test.
+# Run this to generate and update the repository on vcs-test.golang.org.
+
+set -euo pipefail
+cd "$(dirname "$0")"
+rm -rf prefixtagtests
+mkdir prefixtagtests
+cd prefixtagtests
+
+git init
+mkdir sub
+echo module vcs-test.golang.org/git/prefixtagtests.git/sub >sub/go.mod
+echo package sub >sub/sub.go
+git add sub
+git commit -m 'create module sub'
+for i in v0.1.0 sub/v0.0.9 sub/v0.0.10 v0.2.0; do
+ echo $i >status
+ git add status
+ git commit -m $i
+ git tag $i
+done
+echo 'after last tag' >status
+git add status
+git commit -m 'after last tag'
+
+zip -r ../prefixtagtests.zip .
+gsutil cp ../prefixtagtests.zip gs://vcs-test/git/prefixtagtests.zip