mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
[Vendor] Switch go-version lib (#12719)
* vendor: switch from "mcuadros/go-version" to "hashicorp/go-version" * Adapt P1 * simplify * fix lint * adapt * fix lint & rm old code * no deadlock * rm RWMutex and check GoVersion only 1-time * Copyright header Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
@@ -23,7 +23,6 @@ import (
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"github.com/mcuadros/go-version"
|
||||
"github.com/unknwon/com"
|
||||
)
|
||||
|
||||
@@ -43,11 +42,11 @@ func readAddress(m *models.Mirror) {
|
||||
|
||||
func remoteAddress(repoPath string) (string, error) {
|
||||
var cmd *git.Command
|
||||
binVersion, err := git.BinVersion()
|
||||
err := git.LoadGitVersion()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if version.Compare(binVersion, "2.7", ">=") {
|
||||
if git.CheckGitVersionConstraint(">= 2.7") == nil {
|
||||
cmd = git.NewCommand("remote", "get-url", "origin")
|
||||
} else {
|
||||
cmd = git.NewCommand("config", "--get", "remote.origin.url")
|
||||
|
Reference in New Issue
Block a user