fix building from git url without a protocol

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
v0.8
Tonis Tiigi 2020-12-09 18:40:34 -08:00
parent 8c7c5269df
commit a6baa678ea
2 changed files with 6 additions and 0 deletions

View File

@ -254,6 +254,9 @@ func Git(remote, ref string, opts ...GitOption) State {
remote = parts[0] + "/" + parts[1]
}
}
if protocolType == gitProtocolUnknown {
url = "https://" + url
}
id := remote

View File

@ -102,6 +102,9 @@ func FromLLB(op *pb.Op_Source, platform *pb.Platform) (Identifier, error) {
id.KeepGitDir = true
}
case pb.AttrFullRemoteURL:
if !isGitTransport(v) {
v = "https://" + v
}
id.Remote = v
case pb.AttrAuthHeaderSecret:
id.AuthHeaderSecret = v