git

package
v0.40.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package git allows to interact with Git.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentBranchName

func GetCurrentBranchName(t testing.TestingT) string

GetCurrentBranchName retrieves the current branch name or empty string in case of detached state.

func GetCurrentBranchNameE

func GetCurrentBranchNameE(t testing.TestingT) (string, error)

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

func GetCurrentBranchNameOldE(t testing.TestingT) (string, error)

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

func GetCurrentGitRef(t testing.TestingT) string

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

func GetCurrentGitRefE(t testing.TestingT) (string, error)

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

func GetRepoRoot(t testing.TestingT) string

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

func GetRepoRootE(t testing.TestingT) (string, error)

GetRepoRootE retrieves the path to the root directory of the repo.

func GetTagE added in v0.29.0

func GetTagE(t testing.TestingT) (string, error)

GetTagE retrieves lightweight (non-annotated) tag or if tag points to the commit exact tag value.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL