fixed tag and shit

This commit is contained in:
Carlos Alexandro Becker committed 2016-12-29 09:00:03 -02:00
1 parent b99db9dd97
commit 6880f3b86b
2 files changed
+11 -2

No files matched your search

+3 -1
View File
@@ -21,8 +21,10 @@ func getTag(ref string) (tag string, err error) {
"--tags",
"--abbrev=0",
"--always",
ref,
)
if ref != "" {
cmd.Args = append(cmd.Args, ref)
}
bts, err := cmd.CombinedOutput()
if err != nil {
return tag, errors.New(err.Error() + ": " + string(bts))
+8 -1
View File
@@ -17,4 +17,11 @@ func TestPreviousTag(t *testing.T) {
tag, err := PreviousTag("v0.0.1")
assert.NoError(err)
assert.NotEmpty(tag)
}
}
func TestInvalidRef(t *testing.T) {
assert := assert.New(t)
tag, err := PreviousTag("this-should-not-exist")
assert.Error(err)
assert.Empty(tag)
}