mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 04:14:01 +01:00 
			
		
		
		
	should run RetrieveRepoMetas() for empty pr (#15187)
Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
		
							parent
							
								
									3416e2a825
								
							
						
					
					
						commit
						2b9e0b4d1b
					
				@ -431,11 +431,15 @@ func PrepareCompareDiff(
 | 
				
			|||||||
		ctx.Data["IsNothingToCompare"] = true
 | 
							ctx.Data["IsNothingToCompare"] = true
 | 
				
			||||||
		if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil {
 | 
							if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil {
 | 
				
			||||||
			config := unit.PullRequestsConfig()
 | 
								config := unit.PullRequestsConfig()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if !config.AutodetectManualMerge {
 | 
								if !config.AutodetectManualMerge {
 | 
				
			||||||
				ctx.Data["AllowEmptyPr"] = !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name)
 | 
									allowEmptyPr := !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name)
 | 
				
			||||||
			} else {
 | 
									ctx.Data["AllowEmptyPr"] = allowEmptyPr
 | 
				
			||||||
				ctx.Data["AllowEmptyPr"] = false
 | 
					
 | 
				
			||||||
 | 
									return !allowEmptyPr
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								ctx.Data["AllowEmptyPr"] = false
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return true
 | 
							return true
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user