git

package
v0.2.42 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 17 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShortRef = errors.New("short SHA references are not supported")
	ErrNoRepo   = errors.New("unable to find git repo")
)

Functions

func CloneIfRequired

func CloneIfRequired(ctx context.Context, refName plumbing.ReferenceName, input NewGitCloneExecutorInput, logger log.FieldLogger) (*git.Repository, error)

CloneIfRequired ...

func FindGitRef

func FindGitRef(ctx context.Context, file string) (string, error)

FindGitRef get the current git ref

func FindGitRevision

func FindGitRevision(ctx context.Context, file string) (shortSha string, sha string, err error)

FindGitRevision get the current git revision

func FindGithubRepo

func FindGithubRepo(ctx context.Context, file, githubInstance, remoteName string) (string, error)

FindGithubRepo get the repo

func NewGitCloneExecutor

func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor

NewGitCloneExecutor creates an executor to clone git repos

Types

type Error

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

func (*Error) Commit

func (e *Error) Commit() string

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type NewGitCloneExecutorInput

type NewGitCloneExecutorInput struct {
	URL   string
	Ref   string
	Dir   string
	Token string
}

NewGitCloneExecutorInput the input for the NewGitCloneExecutor

Jump to

Keyboard shortcuts

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