Skip to content

Commit 233db2d

Browse files
committed
fix: only include tags with < 10 chars
1 parent 6cf6cbc commit 233db2d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

internal/git/mod.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ import (
1414
"github.com/go-git/go-git/v5/plumbing/transport/http"
1515
)
1616

17-
type Commit = object.Commit
18-
type Hash = plumbing.Hash
19-
type Repository = git.Repository
20-
type AuthMethod = transport.AuthMethod
21-
type BasicAuth = http.BasicAuth
17+
type (
18+
Commit = object.Commit
19+
Hash = plumbing.Hash
20+
Repository = git.Repository
21+
AuthMethod = transport.AuthMethod
22+
BasicAuth = http.BasicAuth
23+
)
2224

2325
func OpenRepository(path string) (*Repository, error) {
2426
return git.PlainOpen(path)
@@ -103,7 +105,7 @@ func FindTags(repo *Repository, reg *regexp.Regexp) ([]string, error) {
103105
defer tags.Close()
104106

105107
err = tags.ForEach(func(ref *plumbing.Reference) error {
106-
if len(ref.Name().Short()) < 16 && reg.MatchString(ref.Name().Short()) {
108+
if len(ref.Name().Short()) < 10 && reg.MatchString(ref.Name().Short()) {
107109
matchTags = append(matchTags, ref.Name().Short())
108110
}
109111

0 commit comments

Comments
 (0)