From a31abde2e90cd0d4687a9af7abee9c860e1d23b9 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 19 Jan 2019 16:59:13 -0200 Subject: [PATCH] clean: remove uneeded extra tag check --- internal/pipe/git/git.go | 4 ---- internal/pipe/git/git_test.go | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/internal/pipe/git/git.go b/internal/pipe/git/git.go index 71e043710..c48321a5d 100644 --- a/internal/pipe/git/git.go +++ b/internal/pipe/git/git.go @@ -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{ diff --git a/internal/pipe/git/git_test.go b/internal/pipe/git/git_test.go index 599160ea8..4105c80d8 100644 --- a/internal/pipe/git/git_test.go +++ b/internal/pipe/git/git_test.go @@ -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()