diff --git a/go/vcs/vcs.go b/go/vcs/vcs.go index 29242e3b..059f6151 100644 --- a/go/vcs/vcs.go +++ b/go/vcs/vcs.go @@ -585,7 +585,7 @@ var vcsPaths = []*vcsPath{ // Google Code - new syntax { prefix: "code.google.com/", - re: `^(?Pcode\.google\.com/p/(?P[a-z0-9\-]+)(\.(?P[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`, + re: `^(?Pcode\.google\.com/(?:p|r)/(?P[a-z0-9\-]+)(\.(?P[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`, repo: "https://{root}", check: googleCodeVCS, }, diff --git a/go/vcs/vcs_test.go b/go/vcs/vcs_test.go index 0651ecff..0b8dd8c8 100644 --- a/go/vcs/vcs_test.go +++ b/go/vcs/vcs_test.go @@ -25,6 +25,13 @@ func TestRepoRootForImportPath(t *testing.T) { Repo: "https://code.google.com/p/go", }, }, + { + "code.google.com/r/go", + &RepoRoot{ + VCS: vcsHg, + Repo: "https://code.google.com/r/go", + }, + }, { "github.com/golang/groupcache", &RepoRoot{