From 620bd5a3bc640f60a00d8b49c27c51e8ce67e67b Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 18 Sep 2018 14:00:25 -0400 Subject: [PATCH] cmd/go: write an hgrc file in TestMoveHG MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Some variants of Mercurial respond differently to “permission denied” errors than to “file not found”, and we set HOME to point to an absolute path that may produce the former instead of the latter. To discourage Mercurial from trying HOME, give it an explicit (empty) configuration in the working directory instead. Change-Id: I82ae99a6892bba7fc3d41b77209ca181d24315e2 Reviewed-on: https://go-review.googlesource.com/136135 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/cmd/go/go_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 6bd0609eaf..e7d96f6236 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1074,6 +1074,8 @@ func testMove(t *testing.T, vcs, url, base, config string) { defer tg.cleanup() tg.parallel() tg.tempDir("src") + tg.must(os.Mkdir(tg.path(".hg"), 0700)) + tg.must(ioutil.WriteFile(filepath.Join(tg.path(".hg"), "hgrc"), nil, 0600)) tg.setenv("GOPATH", tg.path(".")) tg.run("get", "-d", url) tg.run("get", "-d", "-u", url) -- 2.50.0