1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/pipe/git/errors.go
Carlos Alexandro Becker 69c8a502db
chore(deps): bump github.com/golangci/golangci-lint from 1.23.7 to 1.27.0 (#1563)
* chore(deps): bump github.com/golangci/golangci-lint from 1.23.7 to 1.27.0

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-05-26 00:48:10 -03:00

36 lines
1.1 KiB
Go

package git
import (
"errors"
"fmt"
)
// 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, please check in your pipeline what can be changing the following files:\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 = errors.New("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 = errors.New("current folder is not a git repository")
// ErrNoGit happens when git is not present in PATH.
var ErrNoGit = errors.New("git not present in PATH")