mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
16
vendor/github.com/moby/buildkit/util/gitutil/git_ref.go
generated
vendored
16
vendor/github.com/moby/buildkit/util/gitutil/git_ref.go
generated
vendored
@ -73,22 +73,12 @@ func ParseGitRef(ref string) (*GitRef, error) {
|
||||
}
|
||||
}
|
||||
|
||||
refSplitBySharp := strings.SplitN(ref, "#", 2)
|
||||
res.Remote = refSplitBySharp[0]
|
||||
var fragment string
|
||||
res.Remote, fragment, _ = strings.Cut(ref, "#")
|
||||
if len(res.Remote) == 0 {
|
||||
return res, errdefs.ErrInvalidArgument
|
||||
}
|
||||
|
||||
if len(refSplitBySharp) > 1 {
|
||||
refSplitBySharpSplitByColon := strings.SplitN(refSplitBySharp[1], ":", 2)
|
||||
res.Commit = refSplitBySharpSplitByColon[0]
|
||||
if len(res.Commit) == 0 {
|
||||
return res, errdefs.ErrInvalidArgument
|
||||
}
|
||||
if len(refSplitBySharpSplitByColon) > 1 {
|
||||
res.SubDir = refSplitBySharpSplitByColon[1]
|
||||
}
|
||||
}
|
||||
res.Commit, res.SubDir, _ = strings.Cut(fragment, ":")
|
||||
repoSplitBySlash := strings.Split(res.Remote, "/")
|
||||
res.ShortName = strings.TrimSuffix(repoSplitBySlash[len(repoSplitBySlash)-1], ".git")
|
||||
return res, nil
|
||||
|
Reference in New Issue
Block a user