mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
feat: subgroups (#91)
Several code-hosters like GitLab allow to have subgroups. These were previously not suppported because we weren't able to tell if something was a subgroup or a subdir. By letting users specify the `.git` part of the http string as well, this now work for all protocol, including https.
This commit is contained in:
parent
cd5e2945d2
commit
74a7f9775e
2 changed files with 39 additions and 1 deletions
|
|
@ -169,6 +169,40 @@ func TestParseGit(t *testing.T) {
|
|||
},
|
||||
wantRemote: "https://git.example.com/foo/bar",
|
||||
},
|
||||
{
|
||||
name: "ValidGitSubgroups",
|
||||
uri: "example.com/group/subgroup/repository.git",
|
||||
want: &Dependency{
|
||||
Version: "master",
|
||||
Source: Source{
|
||||
GitSource: &Git{
|
||||
Scheme: GitSchemeHTTPS,
|
||||
Host: "example.com",
|
||||
User: "group/subgroup",
|
||||
Repo: "repository",
|
||||
Subdir: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
wantRemote: "https://example.com/group/subgroup/repository",
|
||||
},
|
||||
{
|
||||
name: "ValidGitSubgroupSubDir",
|
||||
uri: "example.com/group/subgroup/repository.git/subdir",
|
||||
want: &Dependency{
|
||||
Version: "master",
|
||||
Source: Source{
|
||||
GitSource: &Git{
|
||||
Scheme: GitSchemeHTTPS,
|
||||
Host: "example.com",
|
||||
User: "group/subgroup",
|
||||
Repo: "repository",
|
||||
Subdir: "/subdir",
|
||||
},
|
||||
},
|
||||
},
|
||||
wantRemote: "https://example.com/group/subgroup/repository",
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue