check: noVCSSuffix,
},
+ // Git at Apache
+ {
+ prefix: "git.apache.org",
+ re: `^(?P<root>git.apache.org/[a-z0-9_.\-]+\.git)(/[A-Za-z0-9_.\-]+)*$`,
+ vcs: "git",
+ repo: "https://{root}",
+ },
+
// General syntax for any server.
{
re: `^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$`,
"hub.jazz.net/git/USER/pkgname",
nil,
},
+ // Spaces are not valid in package name
+ {
+ "git.apache.org/package name/path/to/lib",
+ nil,
+ },
+ // Should have ".git" suffix
+ {
+ "git.apache.org/package-name/path/to/lib",
+ nil,
+ },
+ {
+ "git.apache.org/package-name.git",
+ &repoRoot{
+ vcs: vcsGit,
+ repo: "https://git.apache.org/package-name.git",
+ },
+ },
+ {
+ "git.apache.org/package-name_2.x.git/path/to/lib",
+ &repoRoot{
+ vcs: vcsGit,
+ repo: "https://git.apache.org/package-name_2.x.git",
+ },
+ },
}
for _, test := range tests {