@@ -253,7 +253,7 @@ var vcsGit = &Cmd{
253
253
254
254
// scpSyntaxRe matches the SCP-like addresses used by Git to access
255
255
// repositories by SSH.
256
- var scpSyntaxRe = lazyregexp .New (`^([a-zA-Z0-9_] +)@([a-zA-Z0-9._ -]+):(.*)$` )
256
+ var scpSyntaxRe = lazyregexp .New (`^(\w +)@([\w. -]+):(.*)$` )
257
257
258
258
func gitRemoteRepo (vcsGit * Cmd , rootDir string ) (remoteRepo string , err error ) {
259
259
cmd := "config remote.origin.url"
@@ -1438,7 +1438,7 @@ var vcsPaths = []*vcsPath{
1438
1438
// GitHub
1439
1439
{
1440
1440
pathPrefix : "github.com" ,
1441
- regexp : lazyregexp .New (`^(?P<root>github\.com/[A-Za-z0-9_ .\-]+/[A-Za-z0-9_ .\-]+)(/[A-Za-z0-9_ .\-]+)*$` ),
1441
+ regexp : lazyregexp .New (`^(?P<root>github\.com/[\w .\-]+/[\w .\-]+)(/[\w .\-]+)*$` ),
1442
1442
vcs : "git" ,
1443
1443
repo : "https://{root}" ,
1444
1444
check : noVCSSuffix ,
@@ -1447,7 +1447,7 @@ var vcsPaths = []*vcsPath{
1447
1447
// Bitbucket
1448
1448
{
1449
1449
pathPrefix : "bitbucket.org" ,
1450
- regexp : lazyregexp .New (`^(?P<root>bitbucket\.org/(?P<bitname>[A-Za-z0-9_ .\-]+/[A-Za-z0-9_ .\-]+))(/[A-Za-z0-9_ .\-]+)*$` ),
1450
+ regexp : lazyregexp .New (`^(?P<root>bitbucket\.org/(?P<bitname>[\w .\-]+/[\w .\-]+))(/[\w .\-]+)*$` ),
1451
1451
vcs : "git" ,
1452
1452
repo : "https://{root}" ,
1453
1453
check : noVCSSuffix ,
@@ -1456,7 +1456,7 @@ var vcsPaths = []*vcsPath{
1456
1456
// IBM DevOps Services (JazzHub)
1457
1457
{
1458
1458
pathPrefix : "hub.jazz.net/git" ,
1459
- regexp : lazyregexp .New (`^(?P<root>hub\.jazz\.net/git/[a-z0-9]+/[A-Za-z0-9_ .\-]+)(/[A-Za-z0-9_ .\-]+)*$` ),
1459
+ regexp : lazyregexp .New (`^(?P<root>hub\.jazz\.net/git/[a-z0-9]+/[\w .\-]+)(/[\w .\-]+)*$` ),
1460
1460
vcs : "git" ,
1461
1461
repo : "https://{root}" ,
1462
1462
check : noVCSSuffix ,
@@ -1465,31 +1465,31 @@ var vcsPaths = []*vcsPath{
1465
1465
// Git at Apache
1466
1466
{
1467
1467
pathPrefix : "git.apache.org" ,
1468
- regexp : lazyregexp .New (`^(?P<root>git\.apache\.org/[a-z0-9_.\-]+\.git)(/[A-Za-z0-9_ .\-]+)*$` ),
1468
+ regexp : lazyregexp .New (`^(?P<root>git\.apache\.org/[a-z0-9_.\-]+\.git)(/[\w .\-]+)*$` ),
1469
1469
vcs : "git" ,
1470
1470
repo : "https://{root}" ,
1471
1471
},
1472
1472
1473
1473
// Git at OpenStack
1474
1474
{
1475
1475
pathPrefix : "git.openstack.org" ,
1476
- regexp : lazyregexp .New (`^(?P<root>git\.openstack\.org/[A-Za-z0-9_ .\-]+/[A-Za-z0-9_ .\-]+)(\.git)?(/[A-Za-z0-9_ .\-]+)*$` ),
1476
+ regexp : lazyregexp .New (`^(?P<root>git\.openstack\.org/[\w .\-]+/[\w .\-]+)(\.git)?(/[\w .\-]+)*$` ),
1477
1477
vcs : "git" ,
1478
1478
repo : "https://{root}" ,
1479
1479
},
1480
1480
1481
1481
// chiselapp.com for fossil
1482
1482
{
1483
1483
pathPrefix : "chiselapp.com" ,
1484
- regexp : lazyregexp .New (`^(?P<root>chiselapp\.com/user/[A-Za-z0-9]+/repository/[A-Za-z0-9_ .\-]+)$` ),
1484
+ regexp : lazyregexp .New (`^(?P<root>chiselapp\.com/user/[A-Za-z0-9]+/repository/[\w .\-]+)$` ),
1485
1485
vcs : "fossil" ,
1486
1486
repo : "https://{root}" ,
1487
1487
},
1488
1488
1489
1489
// General syntax for any server.
1490
1490
// Must be last.
1491
1491
{
1492
- regexp : lazyregexp .New (`(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?(/~?[A-Za-z0-9_ .\-]+)+?)\.(?P<vcs>bzr|fossil|git|hg|svn))(/~?[A-Za-z0-9_ .\-]+)*$` ),
1492
+ regexp : lazyregexp .New (`(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?(/~?[\w .\-]+)+?)\.(?P<vcs>bzr|fossil|git|hg|svn))(/~?[\w .\-]+)*$` ),
1493
1493
schemelessRepo : true ,
1494
1494
},
1495
1495
}
@@ -1502,7 +1502,7 @@ var vcsPathsAfterDynamic = []*vcsPath{
1502
1502
// Launchpad. See golang.org/issue/11436.
1503
1503
{
1504
1504
pathPrefix : "launchpad.net" ,
1505
- regexp : lazyregexp .New (`^(?P<root>launchpad\.net/((?P<project>[A-Za-z0-9_ .\-]+)(?P<series>/[A-Za-z0-9_ .\-]+)?|~[A-Za-z0-9_ .\-]+/(\+junk|[A-Za-z0-9_ .\-]+)/[A-Za-z0-9_ .\-]+))(/[A-Za-z0-9_ .\-]+)*$` ),
1505
+ regexp : lazyregexp .New (`^(?P<root>launchpad\.net/((?P<project>[\w .\-]+)(?P<series>/[\w .\-]+)?|~[\w .\-]+/(\+junk|[\w .\-]+)/[\w .\-]+))(/[\w .\-]+)*$` ),
1506
1506
vcs : "bzr" ,
1507
1507
repo : "https://{root}" ,
1508
1508
check : launchpadVCS ,
0 commit comments