builder/remotecontext: use net/url instead of urlutil

urlutil.IsUrl() was merely checking if the url had a http(s)://
prefix, which is just as well handled through using url.Parse()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2019-11-05 09:26:30 -08:00
parent a0d9b0cf0d
commit 2d0d4ce4af
2 changed files with 29 additions and 3 deletions

View File

@ -24,6 +24,14 @@ func TestParseRemoteURL(t *testing.T) {
url string
expected gitRepo
}{
{
doc: "git scheme uppercase, no url-fragment",
url: "GIT://github.com/user/repo.git",
expected: gitRepo{
remote: "git://github.com/user/repo.git",
ref: "master",
},
},
{
doc: "git scheme, no url-fragment",
url: "git://github.com/user/repo.git",