更改:同步分支条件

This commit is contained in:
yystopf 2024-03-22 17:35:58 +08:00
parent 54c458b31c
commit c88506a8f7
1 changed files with 1 additions and 1 deletions

View File

@ -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)