1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-17 01:42:37 +02:00

Revert "trying with test fixtures"

This reverts commit 0b7936eb0d.
This commit is contained in:
Carlos Alexandro Becker
2017-04-15 14:00:29 -03:00
parent 0b7936eb0d
commit e39dfa1ce9
7 changed files with 28 additions and 71 deletions

View File

@ -3,7 +3,6 @@
package git
import (
"log"
"os"
"regexp"
"strings"
@ -38,7 +37,6 @@ func (p Pipe) Run(ctx *context.Context) (err error) {
}
func (Pipe) doRun(ctx *context.Context, pwd string) (err error) {
log.Println("git:", pwd)
tag, err := cleanGit(pwd, "describe", "--tags", "--abbrev=0", "--always")
if err != nil {
return
@ -58,16 +56,16 @@ func (Pipe) doRun(ctx *context.Context, pwd string) (err error) {
PreviousTag: prev,
Diff: log,
}
commit, err := cleanGit(pwd, "show", "--format='%H'", "HEAD")
if err != nil {
return
}
ctx.Git.Commit = commit
// removes usual `v` prefix
ctx.Version = strings.TrimPrefix(tag, "v")
if versionErr := isVersionValid(ctx.Version); versionErr != nil {
return versionErr
}
commit, err := cleanGit(pwd, "show", "--format='%H'", "HEAD")
if err != nil {
return
}
ctx.Git.Commit = commit
return
}