mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
		@@ -83,7 +83,7 @@ func IsCommitStatusContextSuccess(commitStatuses []*git_model.CommitStatus, requ
 | 
			
		||||
 | 
			
		||||
// IsPullCommitStatusPass returns if all required status checks PASS
 | 
			
		||||
func IsPullCommitStatusPass(ctx context.Context, pr *issues_model.PullRequest) (bool, error) {
 | 
			
		||||
	if err := pr.LoadProtectedBranchCtx(ctx); err != nil {
 | 
			
		||||
	if err := pr.LoadProtectedBranch(ctx); err != nil {
 | 
			
		||||
		return false, errors.Wrap(err, "GetLatestCommitStatus")
 | 
			
		||||
	}
 | 
			
		||||
	if pr.ProtectedBranch == nil || !pr.ProtectedBranch.EnableStatusCheck {
 | 
			
		||||
@@ -137,7 +137,7 @@ func GetPullRequestCommitStatusState(ctx context.Context, pr *issues_model.PullR
 | 
			
		||||
		return "", errors.Wrap(err, "GetLatestCommitStatus")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := pr.LoadProtectedBranchCtx(ctx); err != nil {
 | 
			
		||||
	if err := pr.LoadProtectedBranch(ctx); err != nil {
 | 
			
		||||
		return "", errors.Wrap(err, "LoadProtectedBranch")
 | 
			
		||||
	}
 | 
			
		||||
	var requiredContexts []string
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user