Documentation ¶
Overview ¶
Package git allows to interact with Git.
Index ¶
- func GetCurrentBranchName(t testing.TestingT) string
- func GetCurrentBranchNameE(t testing.TestingT) (string, error)
- func GetCurrentBranchNameOldE(t testing.TestingT) (string, error)
- func GetCurrentGitRef(t testing.TestingT) string
- func GetCurrentGitRefE(t testing.TestingT) (string, error)
- func GetRepoRoot(t testing.TestingT) string
- func GetRepoRootE(t testing.TestingT) (string, error)
- func GetTagE(t testing.TestingT) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentBranchName ¶
GetCurrentBranchName retrieves the current branch name or empty string in case of detached state.
func GetCurrentBranchNameE ¶
GetCurrentBranchNameE retrieves the current branch name or empty string in case of detached state. Uses branch --show-current, which was introduced in git v2.22. Falls back to rev-parse for users of the older version, like Ubuntu 18.04.
func GetCurrentBranchNameOldE ¶
GetCurrentBranchNameOldE retrieves the current branch name or empty string in case of detached state. This uses the older pattern of `git rev-parse` rather than `git branch --show-current`.
func GetCurrentGitRef ¶
GetCurrentGitRef retrieves current branch name, lightweight (non-annotated) tag or if tag points to the commit exact tag value.
func GetCurrentGitRefE ¶
GetCurrentGitRefE retrieves current branch name, lightweight (non-annotated) tag or if tag points to the commit exact tag value.
func GetRepoRoot ¶
GetRepoRoot retrieves the path to the root directory of the repo. This fails the test if there is an error.
func GetRepoRootE ¶
GetRepoRootE retrieves the path to the root directory of the repo.
Types ¶
This section is empty.