@@ -27,7 +27,6 @@ import (
2727 "code.gitea.io/gitea/modules/optional"
2828 "code.gitea.io/gitea/modules/queue"
2929 repo_module "code.gitea.io/gitea/modules/repository"
30- "code.gitea.io/gitea/modules/reqctx"
3130 "code.gitea.io/gitea/modules/timeutil"
3231 "code.gitea.io/gitea/modules/util"
3332 webhook_module "code.gitea.io/gitea/modules/webhook"
@@ -647,7 +646,7 @@ type BranchDivergingInfo struct {
647646}
648647
649648// GetBranchDivergingInfo returns the information about the divergence of a patch branch to the base branch.
650- func GetBranchDivergingInfo (ctx reqctx. RequestContext , baseRepo * repo_model.Repository , baseBranch string , headRepo * repo_model.Repository , headBranch string ) (* BranchDivergingInfo , error ) {
649+ func GetBranchDivergingInfo (ctx context. Context , baseRepo * repo_model.Repository , baseBranch string , headRepo * repo_model.Repository , headBranch string ) (* BranchDivergingInfo , error ) {
651650 headGitBranch , err := git_model .GetBranch (ctx , headRepo .ID , headBranch )
652651 if err != nil {
653652 return nil , err
@@ -673,10 +672,12 @@ func GetBranchDivergingInfo(ctx reqctx.RequestContext, baseRepo *repo_model.Repo
673672 return info , nil
674673 }
675674 // if the base's update time is before the fork, check whether the base's head is in the fork
676- headGitRepo , err := gitrepo .RepositoryFromRequestContextOrOpen (ctx , headRepo )
675+ headGitRepo , closer , err := gitrepo .RepositoryFromContextOrOpen (ctx , headRepo )
677676 if err != nil {
678677 return nil , err
679678 }
679+ defer closer .Close ()
680+
680681 headCommit , err := headGitRepo .GetCommit (headGitBranch .CommitID )
681682 if err != nil {
682683 return nil , err
0 commit comments