github.com/szyn/goreleaser@v0.76.1-0.20180517112710-333da09a1297/pipeline/git/errors.go (about)

     1  package git
     2  
     3  import "fmt"
     4  
     5  // ErrInvalidVersionFormat is return when the version isnt in a valid format
     6  type ErrInvalidVersionFormat struct {
     7  	version string
     8  }
     9  
    10  func (e ErrInvalidVersionFormat) Error() string {
    11  	return fmt.Sprintf("%v is not in a valid version format", e.version)
    12  }
    13  
    14  // ErrDirty happens when the repo has uncommitted/unstashed changes
    15  type ErrDirty struct {
    16  	status string
    17  }
    18  
    19  func (e ErrDirty) Error() string {
    20  	return fmt.Sprintf("git is currently in a dirty state:\n%v", e.status)
    21  }
    22  
    23  // ErrWrongRef happens when the HEAD reference is different from the tag being built
    24  type ErrWrongRef struct {
    25  	commit, tag string
    26  }
    27  
    28  func (e ErrWrongRef) Error() string {
    29  	return fmt.Sprintf("git tag %v was not made against commit %v", e.tag, e.commit)
    30  }
    31  
    32  // ErrNoTag happens if the underlying git repository doesn't contain any tags
    33  // but no snapshot-release was requested.
    34  var ErrNoTag = fmt.Errorf("git doesn't contain any tags. Either add a tag or use --snapshot")
    35  
    36  // ErrNotRepository happens if you try to run goreleaser against a folder
    37  // which is not a git repository.
    38  var ErrNotRepository = fmt.Errorf("current folder is not a git repository")