1
0
Fork 0
forked from forgejo/forgejo

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:
zeripath 2020-10-21 16:42:08 +01:00 committed by GitHub
parent 53359b1861
commit de6e427a01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 25 additions and 25 deletions

View file

@ -131,7 +131,7 @@ func initRepoCommit(tmpPath string, repo *models.Repository, u *models.User, def
"-m", "Initial commit",
}
if git.CheckGitVersionConstraint(">= 1.7.9") == nil {
if git.CheckGitVersionAtLeast("1.7.9") == nil {
sign, keyID, signer, _ := models.SignInitialCommit(tmpPath, u)
if sign {
args = append(args, "-S"+keyID)
@ -141,7 +141,7 @@ func initRepoCommit(tmpPath string, repo *models.Repository, u *models.User, def
committerName = signer.Name
committerEmail = signer.Email
}
} else if git.CheckGitVersionConstraint(">= 2.0.0") == nil {
} else if git.CheckGitVersionAtLeast("2.0.0") == nil {
args = append(args, "--no-gpg-sign")
}
}