Merge branch 'feature' into develop

This commit is contained in:
yystopf 2024-03-22 17:15:53 +08:00
commit 4b8ba4576e
1 changed files with 7 additions and 7 deletions

View File

@ -58,13 +58,13 @@ 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
// totalNumOfBranches, err = repo_module.SyncRepoBranches(ctx, ctx.Repo.Repository.ID, 0)
// if err != nil {
// ctx.ServerError("SyncRepoBranches", err)
// return
// }
// }
if totalNumOfBranches == 0 { // 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)
return
}
}
rules, err := git_model.FindRepoProtectedBranchRules(ctx, ctx.Repo.Repository.ID)
if err != nil {