1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +02:00
goreleaser/pipeline/git/errors.go
Carlos Alexandro Becker 2ea883e0c4
* feat: allow snapshots on a folder that is not a git repo (#579)
* feat: allow running against a folder that is not a git repo

* test: cover clean err

* test: release: increase coverage

* test: fix race condition
2018-02-25 20:17:45 -03:00

39 lines
1.1 KiB
Go

package git
import "fmt"
// ErrInvalidVersionFormat is return when the version isnt in a valid format
type ErrInvalidVersionFormat struct {
version string
}
func (e ErrInvalidVersionFormat) Error() string {
return fmt.Sprintf("%v is not in a valid version format", e.version)
}
// ErrDirty happens when the repo has uncommitted/unstashed changes
type ErrDirty struct {
status string
}
func (e ErrDirty) Error() string {
return fmt.Sprintf("git is currently in a dirty state:\n%v", e.status)
}
// ErrWrongRef happens when the HEAD reference is different from the tag being built
type ErrWrongRef struct {
commit, tag string
}
func (e ErrWrongRef) Error() string {
return fmt.Sprintf("git tag %v was not made against commit %v", e.tag, e.commit)
}
// ErrNoTag happens if the underlying git repository doesn't contain any tags
// but no snapshot-release was requested.
var ErrNoTag = fmt.Errorf("git doesn't contain any tags. Either add a tag or use --snapshot")
// ErrNotRepository happens if you try to run goreleaser against a folder
// which is not a git repository.
var ErrNotRepository = fmt.Errorf("current folder is not a git repository")