common

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestGitConfig = &config.Config{
		User: struct {
			Name  string
			Email string
		}{
			Name:  testName,
			Email: testEmail,
		},
	}
	TestClock = clockwork.NewFakeClockAt(time.Date(1995, time.October, 26, 9, 0, 0, 0, time.UTC))
)

Functions

func AddNTestCommitsToSpecifiedRef

func AddNTestCommitsToSpecifiedRef(t *testing.T, repo *git.Repository, refName string, n int, signingKeyBytes []byte) []plumbing.Hash

AddNTestCommitsToSpecifiedRef is a test helper that adds test commits to the specified Git ref in the provided repository. Parameter `n` determines how many commits are added. Each commit is associated with a distinct tree. The first commit contains a tree with one object (an empty blob), the second with two objects (both empty blobs), and so on. Each commit is signed using the specified key.

func CreateTestRSLAnnotationEntryCommit

func CreateTestRSLAnnotationEntryCommit(t *testing.T, repo *git.Repository, annotation *rsl.AnnotationEntry, signingKeyBytes []byte) plumbing.Hash

CreateTestRSLAnnotationEntryCommit is a test helper used to create a **signed** RSL annotation using the specified GPG key. It is used to substitute for the default RSL annotation creation and signing mechanism which relies on the user's Git config.

func CreateTestRSLReferenceEntryCommit

func CreateTestRSLReferenceEntryCommit(t *testing.T, repo *git.Repository, entry *rsl.ReferenceEntry, signingKeyBytes []byte) plumbing.Hash

CreateTestRSLReferenceEntryCommit is a test helper used to create a **signed** reference entry using the specified GPG key. It is used to substitute for the default RSL entry creation and signing mechanism which relies on the user's Git config.

func CreateTestSignedTag

func CreateTestSignedTag(t *testing.T, repo *git.Repository, tagName string, target plumbing.Hash, signingKeyBytes []byte) plumbing.Hash

CreateTestSignedTag creates a signed tag in the repository pointing to the target object. The tag is signed using the specified key.

func SignTestCommit

func SignTestCommit(t *testing.T, repo *git.Repository, commit *object.Commit, signingKeyBytes []byte) *object.Commit

SignTestCommit signs the test commit using the specified key stored in the repository. Note that the GPG key is loaded relative to the package containing the test.

func SignTestTag

func SignTestTag(t *testing.T, repo *git.Repository, tag *object.Tag, signingKeyBytes []byte) *object.Tag

SignTestTag signs the specified tag using the test key stored in the repository. Note that the GPG key is loaded relative to the package containing the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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