diff options
author | 6543 <6543@obermui.de> | 2020-09-05 18:42:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 12:42:58 -0400 |
commit | bc11caff94896c8c3f9a5c970a77470ed9beb83a (patch) | |
tree | 75196365a23153cb7e9d13c368fa27d75b3aecfa /services/mirror | |
parent | 9fdb4f887b65a6ddacefc8c7e4580e333d7e4b95 (diff) | |
download | gitea-bc11caff94896c8c3f9a5c970a77470ed9beb83a.tar.gz gitea-bc11caff94896c8c3f9a5c970a77470ed9beb83a.zip |
[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>
Diffstat (limited to 'services/mirror')
-rw-r--r-- | services/mirror/mirror.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/services/mirror/mirror.go b/services/mirror/mirror.go index 75054b690f..da794ea585 100644 --- a/services/mirror/mirror.go +++ b/services/mirror/mirror.go @@ -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") |