diff --git a/services/repository/branch.go b/services/repository/branch.go index e1a313749f..5a8d823eef 100644 --- a/services/repository/branch.go +++ b/services/repository/branch.go @@ -26,7 +26,6 @@ import ( "code.gitea.io/gitea/modules/timeutil" webhook_module "code.gitea.io/gitea/modules/webhook" notify_service "code.gitea.io/gitea/services/notify" - files_service "code.gitea.io/gitea/services/repository/files" "xorm.io/builder" ) @@ -129,21 +128,7 @@ func loadOneBranch(ctx context.Context, repo *repo_model.Repository, dbBranch *g p := protectedBranches.GetFirstMatched(branchName) isProtected := p != nil - var divergence *git.DivergeObject - - // it's not default branch - if repo.DefaultBranch != dbBranch.Name && !dbBranch.IsDeleted { - var err error - divergence, err = files_service.CountDivergingCommits(ctx, repo, git.BranchPrefix+branchName) - if err != nil { - return nil, fmt.Errorf("CountDivergingCommits: %v", err) - } - } - - if divergence == nil { - // tolerate the error that we cannot get divergence - divergence = &git.DivergeObject{Ahead: -1, Behind: -1} - } + divergence := &git.DivergeObject{Ahead: -1, Behind: -1} pr, err := issues_model.GetLatestPullRequestByHeadInfo(ctx, repo.ID, branchName) if err != nil { diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index a577fed450..e102796315 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -102,19 +102,6 @@ {{end}}