Skip to content

Commit

Permalink
(+semver: fix) Fix tag refs (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Benjamin <[email protected]>
  • Loading branch information
annymsMthd authored Aug 6, 2018
1 parent 5a884cd commit ff4263a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
*.out

artifacts/
.vscode/
8 changes: 4 additions & 4 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ func GetCurrentVerion(path string) (version string, err error) {
return "", errors.Wrap(err, "GetCurrentVersion failed")
}

tags, err := r.Tags()
tags, err := r.TagObjects()
if err != nil {
return "", errors.Wrap(err, "GetCurrentVersion failed")
}

err = tags.ForEach(func(ref *plumbing.Reference) error {
c, err := r.CommitObject(ref.Hash())
err = tags.ForEach(func(ref *object.Tag) error {
c, err := ref.Commit()
if err != nil {
return errors.Wrap(err, "GetCurrentVersion failed")
}
tagMap[c.Hash.String()] = ref.Name().Short()
tagMap[c.Hash.String()] = ref.Name
return nil
})
if err != nil {
Expand Down

0 comments on commit ff4263a

Please sign in to comment.