mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
Merge pull request #156 from alonsomoya/feature/bitbucket_url
Support Bitbucket personal repositories
This commit is contained in:
commit
ce1402d0aa
2 changed files with 19 additions and 2 deletions
|
|
@ -106,8 +106,8 @@ const (
|
||||||
gitSSHExp = `ssh://git@(?P<host>.+)/(?P<user>.+)/(?P<repo>.+).git`
|
gitSSHExp = `ssh://git@(?P<host>.+)/(?P<user>.+)/(?P<repo>.+).git`
|
||||||
gitSCPExp = `^git@(?P<host>.+):(?P<user>.+)/(?P<repo>.+).git`
|
gitSCPExp = `^git@(?P<host>.+):(?P<user>.+)/(?P<repo>.+).git`
|
||||||
// The long ugly pattern for ${host} here is a generic pattern for "valid URL with zero or more subdomains and a valid TLD"
|
// 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<host>[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P<user>[-_a-zA-Z0-9/\.]+)/(?P<repo>[-_a-zA-Z0-9\.]+)\.git`
|
gitHTTPSSubgroup = `(?P<host>[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P<user>[-_~a-zA-Z0-9/\.]+)/(?P<repo>[-_a-zA-Z0-9\.]+)\.git`
|
||||||
gitHTTPSExp = `(?P<host>[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P<user>[-_a-zA-Z0-9\.]+)/(?P<repo>[-_a-zA-Z0-9\.]+)`
|
gitHTTPSExp = `(?P<host>[a-zA-Z0-9][a-zA-Z0-9-\.]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,})/(?P<user>[-_~a-zA-Z0-9\.]+)/(?P<repo>[-_a-zA-Z0-9\.]+)`
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,23 @@ func TestParseGit(t *testing.T) {
|
||||||
},
|
},
|
||||||
wantRemote: "https://example.com/group/subgroup/repository.git",
|
wantRemote: "https://example.com/group/subgroup/repository.git",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "ValidBitbucketPersonalRepository",
|
||||||
|
uri: "bitbucket.org/~user/repository.git",
|
||||||
|
want: &Dependency{
|
||||||
|
Version: "master",
|
||||||
|
Source: Source{
|
||||||
|
GitSource: &Git{
|
||||||
|
Scheme: GitSchemeHTTPS,
|
||||||
|
Host: "bitbucket.org",
|
||||||
|
User: "~user",
|
||||||
|
Repo: "repository",
|
||||||
|
Subdir: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wantRemote: "https://bitbucket.org/~user/repository.git",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range tests {
|
for _, c := range tests {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue