mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@d5c1d785b042
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
14
vendor/github.com/moby/buildkit/util/gitutil/git_ref.go
generated
vendored
14
vendor/github.com/moby/buildkit/util/gitutil/git_ref.go
generated
vendored
@ -53,17 +53,17 @@ func ParseGitRef(ref string) (*GitRef, error) {
|
||||
res := &GitRef{}
|
||||
|
||||
var (
|
||||
remote *url.URL
|
||||
remote *GitURL
|
||||
err error
|
||||
)
|
||||
|
||||
if strings.HasPrefix(ref, "github.com/") {
|
||||
res.IndistinguishableFromLocal = true // Deprecated
|
||||
remote = &url.URL{
|
||||
remote = fromURL(&url.URL{
|
||||
Scheme: "https",
|
||||
Host: "github.com",
|
||||
Path: strings.TrimPrefix(ref, "github.com/"),
|
||||
}
|
||||
})
|
||||
} else {
|
||||
remote, err = ParseURL(ref)
|
||||
if errors.Is(err, ErrUnknownProtocol) {
|
||||
@ -87,13 +87,13 @@ func ParseGitRef(ref string) (*GitRef, error) {
|
||||
}
|
||||
}
|
||||
|
||||
res.Commit, res.SubDir = SplitGitFragment(remote.Fragment)
|
||||
remote.Fragment = ""
|
||||
|
||||
res.Remote = remote.String()
|
||||
res.Remote = remote.Remote
|
||||
if res.IndistinguishableFromLocal {
|
||||
_, res.Remote, _ = strings.Cut(res.Remote, "://")
|
||||
}
|
||||
if remote.Fragment != nil {
|
||||
res.Commit, res.SubDir = remote.Fragment.Ref, remote.Fragment.Subdir
|
||||
}
|
||||
|
||||
repoSplitBySlash := strings.Split(res.Remote, "/")
|
||||
res.ShortName = strings.TrimSuffix(repoSplitBySlash[len(repoSplitBySlash)-1], ".git")
|
||||
|
Reference in New Issue
Block a user