Commit 71984fd6 authored by Piyush Mishra's avatar Piyush Mishra Committed by Brad Fitzpatrick

cmd/go/internal/get: fix regexes for "any" character matching

Minor bug: `hubajazz.net` and `gitbapache.org` would match, probably shouldn't

GitHub-Last-Rev: 75bd338569ca41f83b9c36fe3d5ae3b4db0a26cc
GitHub-Pull-Request: golang/go#23755
Change-Id: Ie9c9ab1c15364eccdab8cf3b106b9c370e7f532f
Reviewed-on: https://go-review.googlesource.com/92997
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 25d22d9a
...@@ -971,7 +971,7 @@ var vcsPaths = []*vcsPath{ ...@@ -971,7 +971,7 @@ var vcsPaths = []*vcsPath{
// IBM DevOps Services (JazzHub) // IBM DevOps Services (JazzHub)
{ {
prefix: "hub.jazz.net/git/", prefix: "hub.jazz.net/git/",
re: `^(?P<root>hub.jazz.net/git/[a-z0-9]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`, re: `^(?P<root>hub\.jazz\.net/git/[a-z0-9]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`,
vcs: "git", vcs: "git",
repo: "https://{root}", repo: "https://{root}",
check: noVCSSuffix, check: noVCSSuffix,
...@@ -980,7 +980,7 @@ var vcsPaths = []*vcsPath{ ...@@ -980,7 +980,7 @@ var vcsPaths = []*vcsPath{
// Git at Apache // Git at Apache
{ {
prefix: "git.apache.org/", prefix: "git.apache.org/",
re: `^(?P<root>git.apache.org/[a-z0-9_.\-]+\.git)(/[A-Za-z0-9_.\-]+)*$`, re: `^(?P<root>git\.apache\.org/[a-z0-9_.\-]+\.git)(/[A-Za-z0-9_.\-]+)*$`,
vcs: "git", vcs: "git",
repo: "https://{root}", repo: "https://{root}",
}, },
......
...@@ -59,6 +59,10 @@ func TestRepoRootForImportPath(t *testing.T) { ...@@ -59,6 +59,10 @@ func TestRepoRootForImportPath(t *testing.T) {
"hub.jazz.net", "hub.jazz.net",
nil, nil,
}, },
{
"hubajazz.net",
nil,
},
{ {
"hub2.jazz.net", "hub2.jazz.net",
nil, nil,
...@@ -140,6 +144,10 @@ func TestRepoRootForImportPath(t *testing.T) { ...@@ -140,6 +144,10 @@ func TestRepoRootForImportPath(t *testing.T) {
"git.apache.org/package-name/path/to/lib", "git.apache.org/package-name/path/to/lib",
nil, nil,
}, },
{
"gitbapache.org",
nil,
},
{ {
"git.apache.org/package-name.git", "git.apache.org/package-name.git",
&repoRoot{ &repoRoot{
......
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