git

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SSHKeyAuth added in v0.7.1

func SSHKeyAuth(privateKey []byte, user string, ignoreHostKeys bool) (transport.AuthMethod, error)

Types

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository is an autogenerated mock type for the Repository type

func NewMockRepository

func NewMockRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRepository

NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRepository) Add

func (_m *MockRepository) Add(paths ...string) error

Add provides a mock function with given fields: paths

func (*MockRepository) Commit

func (_m *MockRepository) Commit(message string) (plumbing.Hash, error)

Commit provides a mock function with given fields: message

func (*MockRepository) Config added in v0.5.2

func (_m *MockRepository) Config() (*config.Config, error)

Config provides a mock function with no fields

func (*MockRepository) CreateRemote

func (_m *MockRepository) CreateRemote(name string, url string) (*v5.Remote, error)

CreateRemote provides a mock function with given fields: name, url

func (*MockRepository) EXPECT

func (*MockRepository) Init

func (_m *MockRepository) Init(path string, branch string) (*v5.Repository, error)

Init provides a mock function with given fields: path, branch

func (*MockRepository) InitAndCommit

func (_m *MockRepository) InitAndCommit(dir string, url string, cfg *config.Config) error

InitAndCommit provides a mock function with given fields: dir, url, cfg

func (*MockRepository) PlainCloneContext

func (_m *MockRepository) PlainCloneContext(ctx context.Context, path string, o *v5.CloneOptions) (*v5.Repository, error)

PlainCloneContext provides a mock function with given fields: ctx, path, o

func (*MockRepository) Push

func (_m *MockRepository) Push(o *v5.PushOptions) error

Push provides a mock function with given fields: o

func (*MockRepository) Repo

func (_m *MockRepository) Repo() *v5.Repository

Repo provides a mock function with no fields

type MockRepository_Add_Call

type MockRepository_Add_Call struct {
	*mock.Call
}

MockRepository_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add'

func (*MockRepository_Add_Call) Return

func (*MockRepository_Add_Call) Run

func (_c *MockRepository_Add_Call) Run(run func(paths ...string)) *MockRepository_Add_Call

func (*MockRepository_Add_Call) RunAndReturn

func (_c *MockRepository_Add_Call) RunAndReturn(run func(...string) error) *MockRepository_Add_Call

type MockRepository_Commit_Call

type MockRepository_Commit_Call struct {
	*mock.Call
}

MockRepository_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit'

func (*MockRepository_Commit_Call) Return

func (*MockRepository_Commit_Call) Run

func (_c *MockRepository_Commit_Call) Run(run func(message string)) *MockRepository_Commit_Call

func (*MockRepository_Commit_Call) RunAndReturn

type MockRepository_Config_Call added in v0.5.2

type MockRepository_Config_Call struct {
	*mock.Call
}

MockRepository_Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Config'

func (*MockRepository_Config_Call) Return added in v0.5.2

func (*MockRepository_Config_Call) Run added in v0.5.2

func (*MockRepository_Config_Call) RunAndReturn added in v0.5.2

func (_c *MockRepository_Config_Call) RunAndReturn(run func() (*config.Config, error)) *MockRepository_Config_Call

type MockRepository_CreateRemote_Call

type MockRepository_CreateRemote_Call struct {
	*mock.Call
}

MockRepository_CreateRemote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRemote'

func (*MockRepository_CreateRemote_Call) Return

func (*MockRepository_CreateRemote_Call) Run

func (*MockRepository_CreateRemote_Call) RunAndReturn

type MockRepository_Expecter

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

func (*MockRepository_Expecter) Add

func (_e *MockRepository_Expecter) Add(paths ...interface{}) *MockRepository_Add_Call

Add is a helper method to define mock.On call

  • paths ...string

func (*MockRepository_Expecter) Commit

func (_e *MockRepository_Expecter) Commit(message interface{}) *MockRepository_Commit_Call

Commit is a helper method to define mock.On call

  • message string

func (*MockRepository_Expecter) Config added in v0.5.2

Config is a helper method to define mock.On call

func (*MockRepository_Expecter) CreateRemote

func (_e *MockRepository_Expecter) CreateRemote(name interface{}, url interface{}) *MockRepository_CreateRemote_Call

CreateRemote is a helper method to define mock.On call

  • name string
  • url string

func (*MockRepository_Expecter) Init

func (_e *MockRepository_Expecter) Init(path interface{}, branch interface{}) *MockRepository_Init_Call

Init is a helper method to define mock.On call

  • path string
  • branch string

func (*MockRepository_Expecter) InitAndCommit

func (_e *MockRepository_Expecter) InitAndCommit(dir interface{}, url interface{}, cfg interface{}) *MockRepository_InitAndCommit_Call

InitAndCommit is a helper method to define mock.On call

  • dir string
  • url string
  • cfg *config.Config

func (*MockRepository_Expecter) PlainCloneContext

func (_e *MockRepository_Expecter) PlainCloneContext(ctx interface{}, path interface{}, o interface{}) *MockRepository_PlainCloneContext_Call

PlainCloneContext is a helper method to define mock.On call

  • ctx context.Context
  • path string
  • o *v5.CloneOptions

func (*MockRepository_Expecter) Push

func (_e *MockRepository_Expecter) Push(o interface{}) *MockRepository_Push_Call

Push is a helper method to define mock.On call

  • o *v5.PushOptions

func (*MockRepository_Expecter) Repo

Repo is a helper method to define mock.On call

type MockRepository_InitAndCommit_Call

type MockRepository_InitAndCommit_Call struct {
	*mock.Call
}

MockRepository_InitAndCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitAndCommit'

func (*MockRepository_InitAndCommit_Call) Return

func (*MockRepository_InitAndCommit_Call) Run

func (*MockRepository_InitAndCommit_Call) RunAndReturn

type MockRepository_Init_Call

type MockRepository_Init_Call struct {
	*mock.Call
}

MockRepository_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'

func (*MockRepository_Init_Call) Return

func (*MockRepository_Init_Call) Run

func (_c *MockRepository_Init_Call) Run(run func(path string, branch string)) *MockRepository_Init_Call

func (*MockRepository_Init_Call) RunAndReturn

type MockRepository_PlainCloneContext_Call

type MockRepository_PlainCloneContext_Call struct {
	*mock.Call
}

MockRepository_PlainCloneContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PlainCloneContext'

func (*MockRepository_PlainCloneContext_Call) Return

func (*MockRepository_PlainCloneContext_Call) Run

func (*MockRepository_PlainCloneContext_Call) RunAndReturn

type MockRepository_Push_Call

type MockRepository_Push_Call struct {
	*mock.Call
}

MockRepository_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push'

func (*MockRepository_Push_Call) Return

func (*MockRepository_Push_Call) Run

func (*MockRepository_Push_Call) RunAndReturn

type MockRepository_Repo_Call

type MockRepository_Repo_Call struct {
	*mock.Call
}

MockRepository_Repo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repo'

func (*MockRepository_Repo_Call) Return

func (*MockRepository_Repo_Call) Run

func (*MockRepository_Repo_Call) RunAndReturn

func (_c *MockRepository_Repo_Call) RunAndReturn(run func() *v5.Repository) *MockRepository_Repo_Call

type Repository

type Repository interface {
	// Repo returns the git repository
	Repo() *git.Repository

	// Init initializes a new git repository in the specified path with the
	Init(path string, branch string) (*git.Repository, error)

	// PlainCloneContext clones a git repository to the specified path
	PlainCloneContext(ctx context.Context, path string, o *git.CloneOptions) (*git.Repository, error)

	// CreateRemote creates a new remote with the specified name and url
	CreateRemote(name string, url string) (*git.Remote, error)

	// Add adds the specified files to the repository
	Add(paths ...string) error

	// Commit commits the changes to the repository
	Commit(message string) (plumbing.Hash, error)

	// Push pushes the changes to the remote
	Push(o *git.PushOptions) error

	// InitAndCommit initializes a git repository, adds all files in the directory,
	InitAndCommit(dir string, url string, cfg *config.Config) error

	// Config returns the repository configuration
	Config() (*config.Config, error)
}

Repository is an interface for interacting with git repositories

func NewRepository

func NewRepository(repo *git.Repository) Repository

NewGitRepository returns a new gitRepository

Jump to

Keyboard shortcuts

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