From 70704e780d11f365c701b6c0c89a5866a962ffa6 Mon Sep 17 00:00:00 2001 From: movsb Date: Tue, 10 Dec 2024 14:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=A4=A7=E9=87=8D=E8=AF=95=E5=8A=9B?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/sync/git.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/sync/git.go b/cmd/sync/git.go index 86169ad5..7cf80617 100644 --- a/cmd/sync/git.go +++ b/cmd/sync/git.go @@ -74,7 +74,7 @@ func New(config client.HostConfig, credential Credential, root string, full bool // 内部会自动大量重试因为网络问题导致的错误。 func (g *GitSync) Sync() error { - const MaxRetry = 10 + const MaxRetry = 20 repo, tree, err := g.prepare() if err != nil { @@ -172,8 +172,7 @@ func (g *GitSync) push(repo *git.Repository) error { }, Auth: g.auth, }); err != nil && err != git.NoErrAlreadyUpToDate { - log.Println(`Push 失败:`, err) - return err + return fmt.Errorf(`failed to git push: %w`, err) } return nil }