summaryrefslogtreecommitdiffstats
path: root/modules/setting/git.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-10-21 16:42:08 +0100
committerGitHub <noreply@github.com>2020-10-21 11:42:08 -0400
commitde6e427a0188ef1be6108c5a71979dc4dd679aec (patch)
treeac0d5a17dcac25c4a6f702b6949123d527027002 /modules/setting/git.go
parent53359b1861c79ea688a3c230d235fb515eb44c01 (diff)
downloadgitea-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/git.go')
-rw-r--r--modules/setting/git.go4
1 files changed, 2 insertions, 2 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