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 GetRepoRootForDir(t testing.TestingT, dir string) string
- func GetRepoRootForDirE(t testing.TestingT, dir string) (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 ¶ added in v0.32.15
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 ¶ added in v0.29.0
GetCurrentGitRef retrieves current branch name, lightweight (non-annotated) tag or if tag points to the commit exact tag value.
func GetCurrentGitRefE ¶ added in v0.29.0
GetCurrentGitRefE retrieves current branch name, lightweight (non-annotated) tag or if tag points to the commit exact tag value.
func GetRepoRoot ¶ added in v0.40.6
GetRepoRoot retrieves the path to the root directory of the repo. This fails the test if there is an error.
func GetRepoRootE ¶ added in v0.40.6
GetRepoRootE retrieves the path to the root directory of the repo.
func GetRepoRootForDir ¶ added in v0.46.10
GetRepoRootForDir retrieves the path to the root directory of the repo in which dir resides
func GetRepoRootForDirE ¶ added in v0.46.10
GetRepoRootForDirE retrieves the path to the root directory of the repo in which dir resides
Types ¶
This section is empty.