@@ -15,7 +15,6 @@ import (
1515
1616	"code.gitea.io/gitea/models/db" 
1717	git_model "code.gitea.io/gitea/models/git" 
18- 	access_model "code.gitea.io/gitea/models/perm/access" 
1918	repo_model "code.gitea.io/gitea/models/repo" 
2019	unit_model "code.gitea.io/gitea/models/unit" 
2120	user_model "code.gitea.io/gitea/models/user" 
@@ -196,56 +195,6 @@ func prepareUpstreamDivergingInfo(ctx *context.Context) {
196195	ctx .Data ["UpstreamDivergingInfo" ] =  upstreamDivergingInfo 
197196}
198197
199- func  prepareRecentlyPushedNewBranches (ctx  * context.Context ) {
200- 	if  ctx .Doer  !=  nil  {
201- 		if  err  :=  ctx .Repo .Repository .GetBaseRepo (ctx ); err  !=  nil  {
202- 			ctx .ServerError ("GetBaseRepo" , err )
203- 			return 
204- 		}
205- 
206- 		opts  :=  & git_model.FindRecentlyPushedNewBranchesOptions {
207- 			Repo :     ctx .Repo .Repository ,
208- 			BaseRepo : ctx .Repo .Repository ,
209- 		}
210- 		if  ctx .Repo .Repository .IsFork  {
211- 			opts .BaseRepo  =  ctx .Repo .Repository .BaseRepo 
212- 		}
213- 
214- 		baseRepoPerm , err  :=  access_model .GetUserRepoPermission (ctx , opts .BaseRepo , ctx .Doer )
215- 		if  err  !=  nil  {
216- 			ctx .ServerError ("GetUserRepoPermission" , err )
217- 			return 
218- 		}
219- 
220- 		if  ! opts .Repo .IsMirror  &&  ! opts .BaseRepo .IsMirror  && 
221- 			opts .BaseRepo .UnitEnabled (ctx , unit_model .TypePullRequests ) && 
222- 			baseRepoPerm .CanRead (unit_model .TypePullRequests ) {
223- 			var  finalBranches  []* git_model.RecentlyPushedNewBranch 
224- 			branches , err  :=  git_model .FindRecentlyPushedNewBranches (ctx , ctx .Doer , opts )
225- 			if  err  !=  nil  {
226- 				log .Error ("FindRecentlyPushedNewBranches failed: %v" , err )
227- 			}
228- 
229- 			for  _ , branch  :=  range  branches  {
230- 				divergingInfo , err  :=  repo_service .GetBranchDivergingInfo (ctx ,
231- 					branch .BranchRepo , branch .BranchName , // "base" repo for diverging info 
232- 					opts .BaseRepo , opts .BaseRepo .DefaultBranch , // "head" repo for diverging info 
233- 				)
234- 				if  err  !=  nil  {
235- 					log .Error ("GetBranchDivergingInfo failed: %v" , err )
236- 					continue 
237- 				}
238- 				branchRepoHasNewCommits  :=  divergingInfo .BaseHasNewCommits 
239- 				baseRepoCommitsBehind  :=  divergingInfo .HeadCommitsBehind 
240- 				if  branchRepoHasNewCommits  ||  baseRepoCommitsBehind  >  0  {
241- 					finalBranches  =  append (finalBranches , branch )
242- 				}
243- 			}
244- 			ctx .Data ["RecentlyPushedNewBranches" ] =  finalBranches 
245- 		}
246- 	}
247- }
248- 
249198func  updateContextRepoEmptyAndStatus (ctx  * context.Context , empty  bool , status  repo_model.RepositoryStatus ) {
250199	if  ctx .Repo .Repository .IsEmpty  ==  empty  &&  ctx .Repo .Repository .Status  ==  status  {
251200		return 
0 commit comments