diff options
author | zeripath <art27@cantab.net> | 2020-10-21 16:42:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 11:42:08 -0400 |
commit | de6e427a0188ef1be6108c5a71979dc4dd679aec (patch) | |
tree | ac0d5a17dcac25c4a6f702b6949123d527027002 /modules/repofiles | |
parent | 53359b1861c79ea688a3c230d235fb515eb44c01 (diff) | |
download | gitea-de6e427a0188ef1be6108c5a71979dc4dd679aec.tar.gz gitea-de6e427a0188ef1be6108c5a71979dc4dd679aec.zip |
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>
Diffstat (limited to 'modules/repofiles')
-rw-r--r-- | modules/repofiles/temp_repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/repofiles/temp_repo.go b/modules/repofiles/temp_repo.go index 49a7ddbf19..0d86773643 100644 --- a/modules/repofiles/temp_repo.go +++ b/modules/repofiles/temp_repo.go @@ -214,7 +214,7 @@ func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models args := []string{"commit-tree", treeHash, "-p", "HEAD"} // Determine if we should sign - if git.CheckGitVersionConstraint(">= 1.7.9") == nil { + if git.CheckGitVersionAtLeast("1.7.9") == nil { sign, keyID, signer, _ := t.repo.SignCRUDAction(author, t.basePath, "HEAD") if sign { args = append(args, "-S"+keyID) @@ -231,7 +231,7 @@ func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models } committerSig = signer } - } else if git.CheckGitVersionConstraint(">= 2.0.0") == nil { + } else if git.CheckGitVersionAtLeast("2.0.0") == nil { args = append(args, "--no-gpg-sign") } } @@ -335,7 +335,7 @@ func (t *TemporaryUploadRepository) CheckAttribute(attribute string, args ...str cmdArgs := []string{"check-attr", "-z", attribute} // git check-attr --cached first appears in git 1.7.8 - if git.CheckGitVersionConstraint(">= 1.7.8") == nil { + if git.CheckGitVersionAtLeast("1.7.8") == nil { cmdArgs = append(cmdArgs, "--cached") } cmdArgs = append(cmdArgs, "--") |