git

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitOptions

type GitOptions func() []string

func WithGitBranch

func WithGitBranch(branch string) GitOptions

WithGitBranch returns a GitOptions that specifies the branch to clone.

type GitProvider

type GitProvider interface {
	// Clone clones a git repository to the specified destination
	Clone(ctx context.Context, repoURL string, destDir string, options ...GitOptions) error
	// Checkout checks out a specific commit in the repository at the specified directory.
	Checkout(ctx context.Context, repoDir string, commitHash string) error
	// GetCommitHashBeforeDate returns the commit hash at or before the specified date in the repository.
	GetCommitHashBeforeDate(ctx context.Context, repoDir string, dateTime time.Time) (string, error)
}

type GitProviderImpl

type GitProviderImpl struct {
	// contains filtered or unexported fields
}

func NewGitProviderImpl

func NewGitProviderImpl(eventListener opctx.EventListener, cmdFactory opctx.CmdFactory) (*GitProviderImpl, error)

func (*GitProviderImpl) Checkout

func (g *GitProviderImpl) Checkout(ctx context.Context, repoDir string, commitHash string) error

func (*GitProviderImpl) Clone

func (g *GitProviderImpl) Clone(ctx context.Context, repoURL, destDir string, options ...GitOptions) error

func (*GitProviderImpl) GetCommitHashBeforeDate

func (g *GitProviderImpl) GetCommitHashBeforeDate(
	ctx context.Context, repoDir string, dateTime time.Time,
) (string, error)

Directories

Path Synopsis
Package git_test is a generated GoMock package.
Package git_test is a generated GoMock package.

Jump to

Keyboard shortcuts

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