Help us shape the future of Go! Take the 2026 Go Developer Survey

git

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRemoteName will provide default origin.
	DefaultRemoteName = git.DefaultRemoteName
)

Variables

View Source
var (
	// ErrPackageNotAvailable is an error for handling incorrect package
	ErrPackageNotAvailable = errors.New("package is not available. Supported packages can be found here: https://techdocs.akamai.com/home/page/products-tools-a-z")
)

Functions

This section is empty.

Types

type MockRepo

type MockRepo struct {
	mock.Mock
}

MockRepo impl of Repository interface

func (*MockRepo) Clone

func (m *MockRepo) Clone(_ context.Context, path, repo string, isBare bool, progress terminal.Spinner) error

Clone mock

func (*MockRepo) CommitObject

func (m *MockRepo) CommitObject(h plumbing.Hash) (*object.Commit, error)

CommitObject mock

func (*MockRepo) Head

func (m *MockRepo) Head() (*plumbing.Reference, error)

Head mock

func (*MockRepo) Open

func (m *MockRepo) Open(path string) error

Open mock

func (*MockRepo) Pull

func (m *MockRepo) Pull(_ context.Context, worktree *git.Worktree) error

Pull mock

func (*MockRepo) Reset

func (m *MockRepo) Reset(opts *git.ResetOptions) error

Reset mock

func (*MockRepo) Worktree

func (m *MockRepo) Worktree() (*git.Worktree, error)

Worktree mock

type Repository

type Repository interface {
	Open(path string) error
	Clone(ctx context.Context, path, repo string, isBare bool, progress terminal.Spinner) error
	Pull(ctx context.Context, worktree *git.Worktree) error
	Head() (*plumbing.Reference, error)
	Worktree() (*git.Worktree, error)
	CommitObject(h plumbing.Hash) (*object.Commit, error)
	Reset(opts *git.ResetOptions) error
}

Repository interface.

func NewRepository

func NewRepository() Repository

NewRepository will initialize new git integrations instance.

Jump to

Keyboard shortcuts

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