From c88506a8f739b6b69ca91a600ba4e44a88f8d555 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 22 Mar 2024 17:35:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=86=E6=94=AF=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/hat/repo/branch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/hat/repo/branch.go b/routers/hat/repo/branch.go index ad8e67f..d615f5f 100644 --- a/routers/hat/repo/branch.go +++ b/routers/hat/repo/branch.go @@ -58,7 +58,7 @@ func ListBranches(ctx *context.APIContext) { ctx.Error(http.StatusInternalServerError, "CountBranches", err) return } - if totalNumOfBranches == 0 { // sync branches immediately because non-empty repository should have at least 1 branch + if totalNumOfBranches < 2 { // sync branches immediately because non-empty repository should have at least 1 branch _, err = repo_module.SyncRepoBranches(ctx, ctx.Repo.Repository.ID, 0) if err != nil { ctx.ServerError("SyncRepoBranches", err)