Skip to content

Commit

Permalink
fix(ci): remove unsued code
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Nov 21, 2020
1 parent 89fecf5 commit 66bcf8f
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions internal/client/git.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package client

import (
"fmt"
"io"
"path"
"regexp"
Expand Down Expand Up @@ -208,41 +207,6 @@ func (g *GitClient) Logs(from string, to string) ([]*object.Commit, error) {
return commits, errors.WithStack(err)
}

// get commit hash from a string
// str: HEAD
// str: HASH
// str: tag
func (g *GitClient) getCommitHash(str string) (string, error) {
if str == "HEAD" {
commit, err := g.repository.Head()

if err != nil {
return "", errors.WithStack(err)
}

return commit.Hash().String(), nil
} else {
version := versionRegexp.ReplaceAllString(str, "")
_, err := semver.New(version)

if err != nil {
return "", errors.WithStack(err)
}

tag, err := g.TagName(str)

if err != nil {
return "", errors.WithStack(err)
}

if tag == nil {
return "", errors.New(fmt.Sprintf(`tag '%s' not exist`, str))
}

return tag.Commit.Hash.String(), nil
}
}

// Get tags with range
// eg. Get all tags between v2.0.0 and v1.0.0 and including thenself
// start: v2.0.0
Expand Down

0 comments on commit 66bcf8f

Please sign in to comment.