mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Fix merge dialog on protected branch with missing required statuses (#11074)
It is possible for misconfigured protected branches to have required status checks that are not in any of the current statuses: Pending, Success, Error, Failure, or Warning - presumably because the CI has not contacted us as yet. Fix #10636 by adding case: missing StatusChecks when these are missing
This commit is contained in:
		@@ -451,9 +451,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
 | 
			
		||||
			}
 | 
			
		||||
			return false
 | 
			
		||||
		}
 | 
			
		||||
		state := pull_service.MergeRequiredContextsCommitStatus(commitStatuses, pull.ProtectedBranch.StatusCheckContexts)
 | 
			
		||||
		ctx.Data["RequiredStatusCheckState"] = state
 | 
			
		||||
		ctx.Data["IsRequiredStatusCheckSuccess"] = state.IsSuccess()
 | 
			
		||||
		ctx.Data["RequiredStatusCheckState"] = pull_service.MergeRequiredContextsCommitStatus(commitStatuses, pull.ProtectedBranch.StatusCheckContexts)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ctx.Data["HeadBranchMovedOn"] = headBranchSha != sha
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user