mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-07 13:31:37 +02:00
clean: remove uneeded extra tag check
This commit is contained in:
parent
df831077e5
commit
a31abde2e9
@ -2,7 +2,6 @@ package git
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/apex/log"
|
||||
@ -112,9 +111,6 @@ func validate(ctx *context.Context) error {
|
||||
if strings.TrimSpace(out) != "" || err != nil {
|
||||
return ErrDirty{status: out}
|
||||
}
|
||||
if !regexp.MustCompile("^[0-9.]+").MatchString(ctx.Version) {
|
||||
return ErrInvalidVersionFormat{version: ctx.Version}
|
||||
}
|
||||
_, err = git.Clean(git.Run("describe", "--exact-match", "--tags", "--match", ctx.Git.CurrentTag))
|
||||
if err != nil {
|
||||
return ErrWrongRef{
|
||||
|
@ -76,18 +76,6 @@ func TestNoTagsNoSnapshot(t *testing.T) {
|
||||
assert.EqualError(t, Pipe{}.Run(ctx), `git doesn't contain any tags. Either add a tag or use --snapshot`)
|
||||
}
|
||||
|
||||
func TestInvalidTagFormat(t *testing.T) {
|
||||
_, back := testlib.Mktmp(t)
|
||||
defer back()
|
||||
testlib.GitInit(t)
|
||||
testlib.GitRemoteAdd(t, "git@github.com:foo/bar.git")
|
||||
testlib.GitCommit(t, "commit2")
|
||||
testlib.GitTag(t, "sadasd")
|
||||
var ctx = context.New(config.Project{})
|
||||
assert.EqualError(t, Pipe{}.Run(ctx), "sadasd is not in a valid version format")
|
||||
assert.Equal(t, "sadasd", ctx.Git.CurrentTag)
|
||||
}
|
||||
|
||||
func TestDirty(t *testing.T) {
|
||||
folder, back := testlib.Mktmp(t)
|
||||
defer back()
|
||||
|
Loading…
x
Reference in New Issue
Block a user