diff --git a/pkgs/forgejo/branch-view_remove-expensive-commit-divergence-metric.patch b/pkgs/forgejo/branch-view_remove-expensive-commit-divergence-metric.patch new file mode 100644 index 0000000..c4bb4c2 --- /dev/null +++ b/pkgs/forgejo/branch-view_remove-expensive-commit-divergence-metric.patch @@ -0,0 +1,59 @@ +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}} + +