git2goutil

package
v16.0.0-rc42 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommitSignature

func CreateCommitSignature(signingKeyPath, contentToSign string) (string, error)

CreateCommitSignature reads the given signing key and produces PKCS#7 detached signature. When the path to the signing key is not present, an empty signature is returned.

func OpenRepository

func OpenRepository(path string) (*git.Repository, error)

OpenRepository opens the repository located at path as a Git2Go repository.

Types

type CommitSubmitter

type CommitSubmitter struct {
	Repo           *git.Repository
	SigningKeyPath string
}

CommitSubmitter is the helper struct to make signed Commits conveniently.

func NewCommitSubmitter

func NewCommitSubmitter(repo *git.Repository, signingKeyPath string) *CommitSubmitter

NewCommitSubmitter creates a new CommitSubmitter.

func (*CommitSubmitter) Commit

func (cs *CommitSubmitter) Commit(
	author, committer *git.Signature,
	messageEncoding git.MessageEncoding,
	message string,
	tree *git.Tree,
	parents ...*git.Commit,
) (*git.Oid, error)

Commit commits a commit with or without OpenPGP signature depends on SigningKeyPath value.

Jump to

Keyboard shortcuts

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