summaryrefslogtreecommitdiffstats
path: root/modules/git/commit.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/commit.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/commit.go')
-rw-r--r--modules/git/commit.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/git/commit.go b/modules/git/commit.go
index 2ae35c9f58..6d2bc2b02c 100644
--- a/modules/git/commit.go
+++ b/modules/git/commit.go
@@ -21,7 +21,6 @@ import (
"strings"
"github.com/go-git/go-git/v5/plumbing/object"
- "github.com/mcuadros/go-version"
)
// Commit represents a git commit.
@@ -470,7 +469,7 @@ func (c *Commit) GetSubModule(entryname string) (*SubModule, error) {
// GetBranchName gets the closest branch name (as returned by 'git name-rev --name-only')
func (c *Commit) GetBranchName() (string, error) {
- binVersion, err := BinVersion()
+ err := LoadGitVersion()
if err != nil {
return "", fmt.Errorf("Git version missing: %v", err)
}
@@ -478,7 +477,7 @@ func (c *Commit) GetBranchName() (string, error) {
args := []string{
"name-rev",
}
- if version.Compare(binVersion, "2.13.0", ">=") {
+ if CheckGitVersionConstraint(">= 2.13.0") == nil {
args = append(args, "--exclude", "refs/tags/*")
}
args = append(args, "--name-only", "--no-undefined", c.ID.String())