mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Don't list root repository on compare page if pulls not allowed (#24183)
Fix #24165
This commit is contained in:
		@@ -459,7 +459,7 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
 | 
			
		||||
		rootRepo.ID != ci.HeadRepo.ID &&
 | 
			
		||||
		rootRepo.ID != baseRepo.ID {
 | 
			
		||||
		canRead := access_model.CheckRepoUnitUser(ctx, rootRepo, ctx.Doer, unit.TypeCode)
 | 
			
		||||
		if canRead {
 | 
			
		||||
		if canRead && rootRepo.AllowsPulls() {
 | 
			
		||||
			ctx.Data["RootRepo"] = rootRepo
 | 
			
		||||
			if !fileOnly {
 | 
			
		||||
				branches, tags, err := getBranchesAndTagsForRepo(ctx, rootRepo)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user