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/setting | |
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/setting')
-rw-r--r-- | modules/setting/git.go | 4 | ||||
-rw-r--r-- | modules/setting/lfs.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/setting/git.go b/modules/setting/git.go index d696f5f18a..968de55753 100644 --- a/modules/setting/git.go +++ b/modules/setting/git.go @@ -74,7 +74,7 @@ func newGit() { log.Fatal("Error retrieving git version: %v", err) } - if git.CheckGitVersionConstraint(">= 2.9") == nil { + if git.CheckGitVersionAtLeast("2.9") == nil { // Explicitly disable credential helper, otherwise Git credentials might leak git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "credential.helper=") } @@ -82,7 +82,7 @@ func newGit() { var format = "Git Version: %s" var args = []interface{}{version.Original()} // Since git wire protocol has been released from git v2.18 - if Git.EnableAutoGitWireProtocol && git.CheckGitVersionConstraint(">= 2.18") == nil { + if Git.EnableAutoGitWireProtocol && git.CheckGitVersionAtLeast("2.18") == nil { git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "protocol.version=2") format += ", Wire Protocol %s Enabled" args = append(args, "Version 2") // for focus color diff --git a/modules/setting/lfs.go b/modules/setting/lfs.go index 8ba8b00851..5af80c2ab1 100644 --- a/modules/setting/lfs.go +++ b/modules/setting/lfs.go @@ -96,7 +96,7 @@ func CheckLFSVersion() { log.Fatal("Error retrieving git version: %v", err) } - if git.CheckGitVersionConstraint(">= 2.1.2") != nil { + if git.CheckGitVersionAtLeast("2.1.2") != nil { LFS.StartServer = false log.Error("LFS server support needs at least Git v2.1.2") } else { |