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{
// IBM DevOps Services (JazzHub)
{
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",
repo: "https://{root}",
check: noVCSSuffix,
......@@ -980,7 +980,7 @@ var vcsPaths = []*vcsPath{
// Git at Apache
{
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",
repo: "https://{root}",
},
......
......@@ -59,6 +59,10 @@ func TestRepoRootForImportPath(t *testing.T) {
"hub.jazz.net",
nil,
},
{
"hubajazz.net",
nil,
},
{
"hub2.jazz.net",
nil,
......@@ -140,6 +144,10 @@ func TestRepoRootForImportPath(t *testing.T) {
"git.apache.org/package-name/path/to/lib",
nil,
},
{
"gitbapache.org",
nil,
},
{
"git.apache.org/package-name.git",
&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