summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/tag_loader.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/git_commands/tag_loader.go')
-rw-r--r--pkg/commands/git_commands/tag_loader.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/pkg/commands/git_commands/tag_loader.go b/pkg/commands/git_commands/tag_loader.go
index f9674a2b0..738283405 100644
--- a/pkg/commands/git_commands/tag_loader.go
+++ b/pkg/commands/git_commands/tag_loader.go
@@ -1,8 +1,6 @@
package git_commands
import (
- "fmt"
-
"github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
@@ -12,31 +10,23 @@ import (
type TagLoader struct {
*common.Common
- version *GitVersion
- cmd oscommands.ICmdObjBuilder
+ cmd oscommands.ICmdObjBuilder
}
func NewTagLoader(
common *common.Common,
- version *GitVersion,
cmd oscommands.ICmdObjBuilder,
) *TagLoader {
return &TagLoader{
- Common: common,
- version: version,
- cmd: cmd,
+ Common: common,
+ cmd: cmd,
}
}
func (self *TagLoader) GetTags() ([]*models.Tag, error) {
// get remote branches, sorted by creation date (descending)
// see: https://git-scm.com/docs/git-tag#Documentation/git-tag.txt---sortltkeygt
- sortKey := "-creatordate"
- if self.version.IsOlderThan(2, 7, 0) {
- sortKey = "-v:refname"
- }
-
- tagsOutput, err := self.cmd.New(fmt.Sprintf(`git tag --list --sort=%s`, sortKey)).DontLog().RunWithOutput()
+ tagsOutput, err := self.cmd.New(`git tag --list --sort=-creatordate`).DontLog().RunWithOutput()
if err != nil {
return nil, err
}