aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2018-12-13 09:23:25 -0500
committerBryan C. Mills <bcmills@google.com>2018-12-13 16:33:50 +0000
commit897b44e439e6407018fa27af82aca62ea7179287 (patch)
tree209426db76ff548cf7ded525c0e147db51d72323
parent914efab0ebb5e6ae471c2f464cf465b995fe2df2 (diff)
downloadgo-897b44e439e6407018fa27af82aca62ea7179287.tar.gz
go-897b44e439e6407018fa27af82aca62ea7179287.zip
[release-branch.go1.11-security] cmd/go: set user and email in test-local git repos
Some of the builders cannot infer user and email from the builder hostname. Change-Id: I6f343ae41ca7d984797e595867c8210b404b782f Reviewed-on: https://team-review.git.corp.google.com/c/376740 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
-rw-r--r--src/cmd/go/testdata/script/get_brace.txt4
-rw-r--r--src/cmd/go/testdata/script/get_dotfiles.txt4
-rw-r--r--src/cmd/go/testdata/script/get_unicode.txt9
3 files changed, 17 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/get_brace.txt b/src/cmd/go/testdata/script/get_brace.txt
index 36414d7b55..be81d8f487 100644
--- a/src/cmd/go/testdata/script/get_brace.txt
+++ b/src/cmd/go/testdata/script/get_brace.txt
@@ -3,11 +3,15 @@
# Set up some empty repositories.
cd $WORK/_origin/foo
exec git init
+exec git config user.name 'Nameless Gopher'
+exec git config user.email 'nobody@golang.org'
exec git commit --allow-empty -m 'create master branch'
cd $WORK
cd '_origin/{confusing}'
exec git init
+exec git config user.name 'Nameless Gopher'
+exec git config user.email 'nobody@golang.org'
exec git commit --allow-empty -m 'create master branch'
# Clone the empty repositories into GOPATH.
diff --git a/src/cmd/go/testdata/script/get_dotfiles.txt b/src/cmd/go/testdata/script/get_dotfiles.txt
index c09da8beeb..1876114362 100644
--- a/src/cmd/go/testdata/script/get_dotfiles.txt
+++ b/src/cmd/go/testdata/script/get_dotfiles.txt
@@ -3,10 +3,14 @@
# Set up a benign repository and a repository with a dotfile name.
cd $WORK/_origin/foo
exec git init
+exec git config user.name 'Nameless Gopher'
+exec git config user.email 'nobody@golang.org'
exec git commit --allow-empty -m 'create master branch'
cd $WORK/_origin/.hidden
exec git init
+exec git config user.name 'Nameless Gopher'
+exec git config user.email 'nobody@golang.org'
exec git commit --allow-empty -m 'create master branch'
# Clone the empty repositories into GOPATH.
diff --git a/src/cmd/go/testdata/script/get_unicode.txt b/src/cmd/go/testdata/script/get_unicode.txt
index a30802b999..31edcdb9f6 100644
--- a/src/cmd/go/testdata/script/get_unicode.txt
+++ b/src/cmd/go/testdata/script/get_unicode.txt
@@ -1,23 +1,32 @@
[!exec:git] skip
+# Construct a repository that imports a non-ASCII path.
cd $WORK/_origin/example.com/unicode
exec git init
+exec git config user.name 'Nameless Gopher'
+exec git config user.email 'nobody@golang.org'
exec git add unicode.go
exec git commit -m 'add unicode.go'
+# Clone the repo into GOPATH so that 'go get -u' can find it.
mkdir $GOPATH/src/example.com/unicode
cd $GOPATH/src/example.com/unicode
exec git clone $WORK/_origin/example.com/unicode .
+# Construct the imported repository.
cd $WORK/_origin/example.com/испытание
exec git init
+exec git config user.name 'Nameless Gopher'
+exec git config user.email 'nobody@golang.org'
exec git add испытание.go
exec git commit -m 'add испытание.go'
+# Clone that repo into GOPATH too.
mkdir $GOPATH/src/example.com/испытание
cd $GOPATH/src/example.com/испытание
exec git clone $WORK/_origin/example.com/испытание .
+# Upgrading the importer should pull from the non-ASCII repo.
cd $GOPATH
go get -u example.com/unicode