Commit 862b78e1 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/go: correct directory used in checkNestedVCS test

This error was not used when using git because nested git is permitted.
Add test using Mercurial, so that at least we have a test, even though
the test is not run by default.

Fixes #22157
Fixes #22201

Change-Id: If521f3c09b0754e00e56fa3cd0364764a57a43ad
Reviewed-on: https://go-review.googlesource.com/69670
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent 1ec78d1d
...@@ -1245,7 +1245,7 @@ func testMove(t *testing.T, vcs, url, base, config string) { ...@@ -1245,7 +1245,7 @@ func testMove(t *testing.T, vcs, url, base, config string) {
tg.runFail("get", "-d", "-u", url) tg.runFail("get", "-d", "-u", url)
tg.grepStderr("is a custom import path for", "go get -d -u "+url+" failed for wrong reason") tg.grepStderr("is a custom import path for", "go get -d -u "+url+" failed for wrong reason")
tg.runFail("get", "-d", "-f", "-u", url) tg.runFail("get", "-d", "-f", "-u", url)
tg.grepStderr("validating server certificate|not found", "go get -d -f -u "+url+" failed for wrong reason") tg.grepStderr("validating server certificate|[nN]ot [fF]ound", "go get -d -f -u "+url+" failed for wrong reason")
} }
func TestInternalPackageErrorsAreHandled(t *testing.T) { func TestInternalPackageErrorsAreHandled(t *testing.T) {
...@@ -1266,10 +1266,9 @@ func TestMoveGit(t *testing.T) { ...@@ -1266,10 +1266,9 @@ func TestMoveGit(t *testing.T) {
testMove(t, "git", "rsc.io/pdf", "pdf", "rsc.io/pdf/.git/config") testMove(t, "git", "rsc.io/pdf", "pdf", "rsc.io/pdf/.git/config")
} }
// TODO(rsc): Set up a test case on bitbucket for hg. func TestMoveHG(t *testing.T) {
// func TestMoveHG(t *testing.T) { testMove(t, "hg", "vcs-test.golang.org/go/custom-hg-hello", "custom-hg-hello", "vcs-test.golang.org/go/custom-hg-hello/.hg/hgrc")
// testMove(t, "hg", "rsc.io/x86/x86asm", "x86", "rsc.io/x86/.hg/hgrc") }
// }
// TODO(rsc): Set up a test case on SourceForge (?) for svn. // TODO(rsc): Set up a test case on SourceForge (?) for svn.
// func testMoveSVN(t *testing.T) { // func testMoveSVN(t *testing.T) {
......
...@@ -599,7 +599,7 @@ func checkNestedVCS(vcs *vcsCmd, dir, srcRoot string) error { ...@@ -599,7 +599,7 @@ func checkNestedVCS(vcs *vcsCmd, dir, srcRoot string) error {
otherDir := dir otherDir := dir
for len(otherDir) > len(srcRoot) { for len(otherDir) > len(srcRoot) {
for _, otherVCS := range vcsList { for _, otherVCS := range vcsList {
if _, err := os.Stat(filepath.Join(dir, "."+otherVCS.cmd)); err == nil { if _, err := os.Stat(filepath.Join(otherDir, "."+otherVCS.cmd)); err == nil {
// Allow expected vcs in original dir. // Allow expected vcs in original dir.
if otherDir == dir && otherVCS == vcs { if otherDir == dir && otherVCS == vcs {
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment