github.com/goreleaser/goreleaser@v1.25.1/internal/pipe/git/errors.go (about)

     1  package git
     2  
     3  import (
     4  	"errors"
     5  	"fmt"
     6  )
     7  
     8  // ErrDirty happens when the repo has uncommitted/unstashed changes.
     9  type ErrDirty struct {
    10  	status string
    11  }
    12  
    13  func (e ErrDirty) Error() string {
    14  	return fmt.Sprintf("git is in a dirty state\nPlease check in your pipeline what can be changing the following files:\n%v\nLearn more at https://goreleaser.com/errors/dirty\n", e.status)
    15  }
    16  
    17  // ErrWrongRef happens when the HEAD reference is different from the tag being built.
    18  type ErrWrongRef struct {
    19  	commit, tag string
    20  }
    21  
    22  func (e ErrWrongRef) Error() string {
    23  	return fmt.Sprintf("git tag %v was not made against commit %v", e.tag, e.commit)
    24  }
    25  
    26  // ErrNoTag happens if the underlying git repository doesn't contain any tags
    27  // but no snapshot-release was requested.
    28  var ErrNoTag = errors.New("git doesn't contain any tags. Either add a tag or use --snapshot")
    29  
    30  // ErrNotRepository happens if you try to run goreleaser against a folder
    31  // which is not a git repository.
    32  var ErrNotRepository = errors.New("current folder is not a git repository")
    33  
    34  // ErrNoGit happens when git is not present in PATH.
    35  var ErrNoGit = errors.New("git not present in PATH")