Documentation ¶
Index ¶
- Constants
- func AnnotatedTag(tag string, cd CommitDetails) error
- func Clean(output string, err error) (string, error)
- func Commit(cd CommitDetails) error
- func EmptyCommit(t *testing.T, commit string) string
- func EmptyCommitAndTag(t *testing.T, tag, msg string) string
- func EmptyCommits(t *testing.T, commits ...string) []string
- func EmptyCommitsAndTag(t *testing.T, tag string, msgs ...string) []string
- func FetchTags() error
- func InitRepo(t *testing.T) string
- func IsRepo() bool
- func MkTmpDir(t *testing.T)
- func Push() error
- func Run(args ...string) (string, error)
- func Stage(path string) error
- func Staged() ([]string, error)
- func Tag(tag string) error
- type CommitDetails
- type LogEntry
- type TagEntry
Constants ¶
const (
InitCommit = "initialise repo"
)
Variables ¶
This section is empty.
Functions ¶
func AnnotatedTag ¶ added in v0.6.0
func AnnotatedTag(tag string, cd CommitDetails) error
AnnotatedTag will create an annotated tag against the repository and push it to the origin
func Commit ¶
func Commit(cd CommitDetails) error
Commit will generate a commit against the repository and push it to the origin. The commit will be associated with the provided author and email address
func EmptyCommit ¶
EmptyCommit will create an empty commit without the need for modifying any existing files within the repository
func EmptyCommitAndTag ¶
EmptyCommitAndTag will create an empty commit with an associated tag. No existing files will be modified within the repository
func EmptyCommits ¶
EmptyCommits will create any number of empty commits without the need for modifying any existing files within the repository
func EmptyCommitsAndTag ¶
EmptyCommitsAndTag will create any number of empty commits and associate them with a tag. No existing files will be modified within the repository
func FetchTags ¶ added in v1.2.0
func FetchTags() error
FetchTags retrieves all tags associated with the remote repository
func InitRepo ¶
InitRepo creates an empty git repository within a temporary directory. Once created the current testing context will operate from within that directory until the calling test has completed
func IsRepo ¶
func IsRepo() bool
IsRepo identifies whether the current working directory is a recognised git repository
func MkTmpDir ¶
MkTmpDir creates an empty directory that is not a git repository. Once created the current testing context will operate from within that directory until the calling test has completed
Types ¶
type CommitDetails ¶ added in v0.4.0
CommitDetails contains mandatory details about a specific git commit
func LatestCommit ¶
func LatestCommit() (CommitDetails, error)
LatestCommit retrieves the latest commit within the repository
func (CommitDetails) String ¶ added in v0.4.0
func (c CommitDetails) String() string
String prints out a user friendly string representation
type LogEntry ¶ added in v1.4.0
LogEntry contains details about a specific git log entry
func LogBetween ¶ added in v1.4.0
LogBetween retrieves all log entries between two points of time within the git history of the repository. Supports tags and specific git hashes as its reference points. From must always be the closest point to HEAD