diff --git a/spec/v1/deps/git.go b/spec/v1/deps/git.go index 9d0567d..862b20a 100644 --- a/spec/v1/deps/git.go +++ b/spec/v1/deps/git.go @@ -106,8 +106,8 @@ const ( gitSSHExp = `ssh://git@(?P.+)/(?P.+)/(?P.+).git` gitSCPExp = `^git@(?P.+):(?P.+)/(?P.+).git` // The long ugly pattern for ${host} here is a generic pattern for "valid URL with zero or more subdomains and a valid TLD" - gitHTTPSSubgroup = `(?P[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P[-_a-zA-Z0-9/]+)/(?P[-_a-zA-Z0-9]+)\.git` - gitHTTPSExp = `(?P[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P[-_a-zA-Z0-9]+)/(?P[-_a-zA-Z0-9]+)` + gitHTTPSSubgroup = `(?P[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P[-_a-zA-Z0-9/\.]+)/(?P[-_a-zA-Z0-9\.]+)\.git` + gitHTTPSExp = `(?P[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P[-_a-zA-Z0-9\.]+)/(?P[-_a-zA-Z0-9\.]+)` ) var ( diff --git a/spec/v1/deps/git_test.go b/spec/v1/deps/git_test.go index 7cbbdcd..969726f 100644 --- a/spec/v1/deps/git_test.go +++ b/spec/v1/deps/git_test.go @@ -84,6 +84,23 @@ func TestParseGit(t *testing.T) { }, wantRemote: "https://example.com/foo/bar.git", }, + { + name: "ValidGitLabUserGroupHTTPS", + uri: "https://gitlab.example.com/first.last/project", + want: &Dependency{ + Version: "master", + Source: Source{ + GitSource: &Git{ + Scheme: GitSchemeHTTPS, + Host: "gitlab.example.com", + User: "first.last", + Repo: "project", + Subdir: "", + }, + }, + }, + wantRemote: "https://gitlab.example.com/first.last/project.git", + }, { name: "ValidGitNoScheme", uri: "example.com/foo/bar",