aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo_attribute.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-05 18:42:58 +0200
committerGitHub <noreply@github.com>2020-09-05 12:42:58 -0400
commitbc11caff94896c8c3f9a5c970a77470ed9beb83a (patch)
tree75196365a23153cb7e9d13c368fa27d75b3aecfa /modules/git/repo_attribute.go
parent9fdb4f887b65a6ddacefc8c7e4580e333d7e4b95 (diff)
downloadgitea-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 'modules/git/repo_attribute.go')
-rw-r--r--modules/git/repo_attribute.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/git/repo_attribute.go b/modules/git/repo_attribute.go
index c10c96f558..7522b0dc82 100644
--- a/modules/git/repo_attribute.go
+++ b/modules/git/repo_attribute.go
@@ -7,8 +7,6 @@ package git
import (
"bytes"
"fmt"
-
- "github.com/mcuadros/go-version"
)
// CheckAttributeOpts represents the possible options to CheckAttribute
@@ -21,7 +19,7 @@ type CheckAttributeOpts struct {
// CheckAttribute return the Blame object of file
func (repo *Repository) CheckAttribute(opts CheckAttributeOpts) (map[string]map[string]string, error) {
- binVersion, err := BinVersion()
+ err := LoadGitVersion()
if err != nil {
return nil, fmt.Errorf("Git version missing: %v", err)
}
@@ -42,7 +40,7 @@ func (repo *Repository) CheckAttribute(opts CheckAttributeOpts) (map[string]map[
}
// git check-attr --cached first appears in git 1.7.8
- if opts.CachedOnly && version.Compare(binVersion, "1.7.8", ">=") {
+ if opts.CachedOnly && CheckGitVersionConstraint(">= 1.7.8") == nil {
cmdArgs = append(cmdArgs, "--cached")
}