diff options
author | Unknwon <u@gogs.io> | 2015-08-09 22:45:38 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-09 22:45:38 +0800 |
commit | 7372042441804370ddcdf00c5ea29acedef99e1d (patch) | |
tree | 1d7765f3d4b4a22393e2575d78d3bf3d250f800c /modules/git | |
parent | 68b9d78386f74e14841ddc20df110591ac7fba23 (diff) | |
download | gitea-7372042441804370ddcdf00c5ea29acedef99e1d.tar.gz gitea-7372042441804370ddcdf00c5ea29acedef99e1d.zip |
list view: issue, label, milestone
Diffstat (limited to 'modules/git')
-rw-r--r-- | modules/git/repo_tag.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/git/repo_tag.go b/modules/git/repo_tag.go index 45a1df7083..8f37d31a2b 100644 --- a/modules/git/repo_tag.go +++ b/modules/git/repo_tag.go @@ -20,12 +20,8 @@ func (repo *Repository) IsTagExist(tagName string) bool { return IsTagExist(repo.Path, tagName) } -// GetTags returns all tags of given repository. -func (repo *Repository) GetTags() ([]string, error) { - if gitVer.AtLeast(MustParseVersion("2.0.0")) { - return repo.getTagsReversed() - } - stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l") +func (repo *Repository) getTagsReversed() ([]string, error) { + stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l", "--sort=-v:refname") if err != nil { return nil, concatenateError(err, stderr) } @@ -33,10 +29,14 @@ func (repo *Repository) GetTags() ([]string, error) { return tags[:len(tags)-1], nil } -func (repo *Repository) getTagsReversed() ([]string, error) { - stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l", "--sort=-v:refname") +// GetTags returns all tags of given repository. +func (repo *Repository) GetTags() ([]string, error) { + if gitVer.AtLeast(MustParseVersion("2.0.0")) { + return repo.getTagsReversed() + } + stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l") if err != nil { - return nil, errors.New(stderr) + return nil, concatenateError(err, stderr) } tags := strings.Split(stdout, "\n") return tags[:len(tags)-1], nil |