feat: generic git https (#73)

Previously, only `github.com` was supported for HTTP cloning of packages.

With this change, every git host using the http protocol (GitHub, Gitlab, Gitea) is supported :D
This commit is contained in:
Cody Boggs 2020-02-03 10:07:44 -07:00 committed by GitHub
parent 8f14d63f95
commit 0ba0ff5522
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 127 additions and 19 deletions

View file

@ -43,17 +43,17 @@ func TestParseDependency(t *testing.T) {
},
{
name: "Invalid",
path: "github.com/foo",
path: "example.com/foo",
want: nil,
},
{
name: "GitHub",
path: "github.com/jsonnet-bundler/jsonnet-bundler",
name: "GitHTTPS",
path: "example.com/jsonnet-bundler/jsonnet-bundler",
want: &deps.Dependency{
Source: deps.Source{
GitSource: &deps.Git{
Scheme: deps.GitSchemeHTTPS,
Host: "github.com",
Host: "example.com",
User: "jsonnet-bundler",
Repo: "jsonnet-bundler",
Subdir: "",