mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: update buildkit to v0.17.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
24
vendor/github.com/moby/buildkit/util/gitutil/git_cli.go
generated
vendored
24
vendor/github.com/moby/buildkit/util/gitutil/git_cli.go
generated
vendored
@ -218,6 +218,14 @@ func (cli *GitCLI) Run(ctx context.Context, args ...string) (_ []byte, err error
|
||||
continue
|
||||
}
|
||||
}
|
||||
if strings.Contains(errbuf.String(), "not our ref") || strings.Contains(errbuf.String(), "unadvertised object") {
|
||||
// server-side error: https://github.com/git/git/blob/34b6ce9b30747131b6e781ff718a45328aa887d0/upload-pack.c#L811-L812
|
||||
// client-side error: https://github.com/git/git/blob/34b6ce9b30747131b6e781ff718a45328aa887d0/fetch-pack.c#L2250-L2253
|
||||
if newArgs := argsNoCommitRefspec(args); len(args) > len(newArgs) {
|
||||
args = newArgs
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
return buf.Bytes(), errors.Wrapf(err, "git stderr:\n%s", errbuf.String())
|
||||
}
|
||||
@ -244,3 +252,19 @@ func argsNoDepth(args []string) []string {
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func argsNoCommitRefspec(args []string) []string {
|
||||
if len(args) <= 2 {
|
||||
return args
|
||||
}
|
||||
if args[0] != "fetch" {
|
||||
return args
|
||||
}
|
||||
|
||||
// assume the refspec is the last arg
|
||||
if IsCommitSHA(args[len(args)-1]) {
|
||||
return args[:len(args)-1]
|
||||
}
|
||||
|
||||
return args
|
||||
}
|
||||
|
19
vendor/github.com/moby/buildkit/util/gitutil/git_commit.go
generated
vendored
Normal file
19
vendor/github.com/moby/buildkit/util/gitutil/git_commit.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
package gitutil
|
||||
|
||||
func IsCommitSHA(str string) bool {
|
||||
if len(str) != 40 {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, ch := range str {
|
||||
if ch >= '0' && ch <= '9' {
|
||||
continue
|
||||
}
|
||||
if ch >= 'a' && ch <= 'f' {
|
||||
continue
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user