mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	go-version constraints ignore pre-releases (#13234)
Go-version constraints ignore pre-releases. Rather than change the library further this PR simply changes the git version comparison to use simple version compare ignoring the issue of pre-releases. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		| @@ -155,7 +155,7 @@ func rawMerge(pr *models.PullRequest, doer *models.User, mergeStyle models.Merge | ||||
| 	} | ||||
|  | ||||
| 	var gitConfigCommand func() *git.Command | ||||
| 	if git.CheckGitVersionConstraint(">= 1.8.0") == nil { | ||||
| 	if git.CheckGitVersionAtLeast("1.8.0") == nil { | ||||
| 		gitConfigCommand = func() *git.Command { | ||||
| 			return git.NewCommand("config", "--local") | ||||
| 		} | ||||
| @@ -214,14 +214,14 @@ func rawMerge(pr *models.PullRequest, doer *models.User, mergeStyle models.Merge | ||||
|  | ||||
| 	// Determine if we should sign | ||||
| 	signArg := "" | ||||
| 	if git.CheckGitVersionConstraint(">= 1.7.9") == nil { | ||||
| 	if git.CheckGitVersionAtLeast("1.7.9") == nil { | ||||
| 		sign, keyID, signer, _ := pr.SignMerge(doer, tmpBasePath, "HEAD", trackingBranch) | ||||
| 		if sign { | ||||
| 			signArg = "-S" + keyID | ||||
| 			if pr.BaseRepo.GetTrustModel() == models.CommitterTrustModel || pr.BaseRepo.GetTrustModel() == models.CollaboratorCommitterTrustModel { | ||||
| 				committer = signer | ||||
| 			} | ||||
| 		} else if git.CheckGitVersionConstraint(">= 2.0.0") == nil { | ||||
| 		} else if git.CheckGitVersionAtLeast("2.0.0") == nil { | ||||
| 			signArg = "--no-gpg-sign" | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user