testutil

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchRefName

func BranchRefName(branch string) string

func CheckoutBranch

func CheckoutBranch(g *WithT, repo *extgogit.Repository, branch string)

func Clone

func Clone(ctx context.Context, repoURL, branchName, remote string) (*extgogit.Repository, string, error)

func CommitIdFromBranch

func CommitIdFromBranch(repo *extgogit.Repository, branchName string) string

func CommitInRepo

func CommitInRepo(ctx context.Context, g *WithT, repoURL, branch, remote, msg string, changeFiles func(path string)) plumbing.Hash

func CommitWorkDir

func CommitWorkDir(g *WithT, repo *extgogit.Repository, branchName, message string) plumbing.Hash

func GetRemoteHead

func GetRemoteHead(repo *extgogit.Repository, branchName, remote string) (plumbing.Hash, error)

func GetSigningKeyPair

func GetSigningKeyPair(g *WithT, passphrase string) (*openpgp.Entity, []byte)

func GetSigningKeyPairSecret

func GetSigningKeyPairSecret(g *WithT, name, namespace string) (*corev1.Secret, *openpgp.Entity)

func HeadFromBranch

func HeadFromBranch(repo *extgogit.Repository, branchName string) (*object.Commit, error)

func InitGitRepo

func InitGitRepo(g *WithT, gitServer *gittestserver.GitServer, fixture, branch, repoPath string) *extgogit.Repository

Initialise a git server with a repo including the files in dir.

func InitGitRepoPlain

func InitGitRepoPlain(g *WithT, fixture, repoPath string) *extgogit.Repository

func ReplaceMarker

func ReplaceMarker(path string, policyKey types.NamespacedName) error

func ReplaceMarkerWithMarker

func ReplaceMarkerWithMarker(path string, policyKey types.NamespacedName, marker string) error

func SetUpGitTestServer

func SetUpGitTestServer(g *WithT) *gittestserver.GitServer

SetUpGitTestServer creates and returns a git test server. The caller must ensure it's stopped and cleaned up.

func TagCommit

func TagCommit(g *WithT, repo *extgogit.Repository, commit plumbing.Hash, annotated bool, tag string, time time.Time) (*plumbing.Reference, error)

func WaitForNewHead

func WaitForNewHead(g *WithT, repo *extgogit.Repository, branch, remote, preChangeHash string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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