summaryrefslogtreecommitdiff
path: root/src/cmd/go/vcs_test.go
Commit message (Collapse)AuthorAgeFilesLines
* cmd/go: match go-import package prefixes by slashStephen McQuay (smcquay)2016-06-031-0/+94
| | | | | | | | | | | | | | | | | | | | | The existing implementation for path collision resolution would incorrectly determine that: example.org/aa collides with: example.org/a This change splits by slash rather than comparing on a byte-by-byte basis. Fixes: #15947 Change-Id: I18b3aaafbc787c81253203cf1328bb3c4420a0c4 Reviewed-on: https://go-review.googlesource.com/23732 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
* vcs: Add support for git.openstack.orgMonty Taylor2016-05-181-0/+33
| | | | | | | | | | | | | | | | | Go is being proposed as an officially supported language for elements of OpenStack: https://review.openstack.org/#/c/312267/ As such, repos that exist in OpenStack's git infrastructure are likely to become places from which people might want to go get things. Allow optional .git suffixes to allow writing code that depends on git.openstack.org repos that will work with older go versions while we wait for this support to roll out. Change-Id: Ia64bdb1dafea33b1c3770803230d30ec1059df22 Reviewed-on: https://go-review.googlesource.com/23135 Reviewed-by: Russ Cox <rsc@golang.org>
* cmd/go: fix vcsFromDir returning bad root on WindowsDmitri Shuralyov2016-04-121-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply golang/tools@5804fef4c0556d3e5e7d2440740a3d7aced7d58b. In the context of cmd/go build tool, import path is a '/'-separated path. This can be inferred from `go help importpath` and `go help packages`. vcsFromDir documentation says on return, root is the import path corresponding to the root of the repository. On Windows and other OSes where os.PathSeparator is not '/', that wasn't true since root would contain characters other than '/', and therefore it wasn't a valid import path corresponding to the root of the repository. Fix that by using filepath.ToSlash. Add test coverage for vcsFromDir, it was previously not tested. It's taken from golang.org/x/tools/go/vcs tests, and modified to improve style. Additionally, remove an unneccessary statement from the documentation "(thus root is a prefix of importPath)". There is no variable importPath that is being referred to (it's possible p.ImportPath was being referred to). Without it, the description of root value matches the documentation of repoRoot.root struct field: // root is the import path corresponding to the root of the // repository root string Rename and change signature of vcsForDir(p *Package) to vcsFromDir(dir, srcRoot string). This is more in sync with the x/tools version. It's also simpler, since vcsFromDir only needs those two values from Package, and nothing more. Change "for" to "from" in name because it's more consistent and clear. Update usage of vcsFromDir to match the new signature, and respect that returned root is a '/'-separated path rather than a os.PathSeparator separated path. Fixes #15040. Updates #7723. Helps #11490. Change-Id: Idf51b9239f57248739daaa200aa1c6e633cb5f7f Reviewed-on: https://go-review.googlesource.com/21345 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/go: remove code specific to Google CodeDominik Honnef2016-03-281-14/+0
| | | | | | | | | | | | | | | | | Remove all special handling of Google Code, which has shut down. Commit 4ec2fd3e6ac4f869d39348bf48016687b731d910 suggested that maybe the shutdown warning should remain. However, it has been missing from Go 1.6 already, and by Go 1.7 people will most likely have realised that Google Code has shut down. Updates #10193. Change-Id: I5749bbbe2fe3b07cff4edd20303bbedaeaa8d77b Reviewed-on: https://go-review.googlesource.com/21189 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: make copyright headers consistent with one space after periodBrad Fitzpatrick2016-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is a subset of https://golang.org/cl/20022 with only the copyright header lines, so the next CL will be smaller and more reviewable. Go policy has been single space after periods in comments for some time. The copyright header template at: https://golang.org/doc/contribute.html#copyright also uses a single space. Make them all consistent. Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0 Reviewed-on: https://go-review.googlesource.com/20111 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/go: disable broken test for code.google.comRuss Cox2016-01-271-2/+2
| | | | | | | | | | | | | For Go 1.7 we can remove all the code.google.com code (except maybe the shutdown warning). See #10193. Change-Id: I4b8182eb66494f0bf373b40ca5da6ae4738342be Reviewed-on: https://go-review.googlesource.com/18974 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/go: support git.apache.org Git reposKonstantin Shaposhnikov2015-07-221-0/+24
| | | | | | | | | | | | | | | This change fixes resolution of secure (https) repo URL for git.apache.org Git repositories. E.g. the correct repo URL for git.apache.org/thrift.git/lib/go/thrift is https://git.apache.org/thrift.git, not https://git.apache.org/thrift Fixes #10797 Change-Id: I67d5312ad8620eb780e42c2e002c8f286f60645a Reviewed-on: https://go-review.googlesource.com/10092 Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* cmd/go: mark ssh:// URLs as secureRoss Light2015-07-141-0/+32
| | | | | | | | Add tests for isSecure function. Change-Id: I49de9d2846b75d4c7be745484f85d351a6fd851d Reviewed-on: https://go-review.googlesource.com/11514 Reviewed-by: Russ Cox <rsc@golang.org>
* cmd/go: don't fetch from insecure repositories without -insecureAndrew Gerrand2015-06-241-1/+1
| | | | | | | | | | Fixes #9637 Fixes #10120 Change-Id: I3728239089efb94d04cd4115c9f840afd7badeaf Reviewed-on: https://go-review.googlesource.com/9715 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* all: extract "can I exec?" check from tests into internal/testenvRuss Cox2015-06-161-8/+3
| | | | | | | | Change-Id: I7b54be9d8b50b39e01c6be21f310ae9a10404e9d Reviewed-on: https://go-review.googlesource.com/10753 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/go: fix a couple of errors found by "go vet"Rob Pike2014-08-151-1/+1
| | | | | | | LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/127410043
* cmd/go: fix build in airplane modeMikio Hara2014-08-081-0/+3
| | | | | | | LGTM=iant R=golang-codereviews, adg, iant CC=golang-codereviews https://golang.org/cl/122190043
* cmd/go: skip vcs tests on nacl and androidDave Cheney2014-07-151-0/+5
| | | | | | | | | Fixes build failures on nacl/* and android/* platforms. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://golang.org/cl/113140043
* go get: Support for IBM DevOps Services (hub.jazz.net) git reposChris McGee2014-07-151-0/+116
LGTM=adg R=golang-codereviews, adg, minux CC=golang-codereviews https://golang.org/cl/106740044