git

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeURL added in v0.1.22

func NormalizeURL(rawURL string) string

NormalizeURL parses and normalizes a git URL for comparison. Returns the normalized form (host/owner/repo) regardless of protocol (HTTPS, SSH, etc).

Types

type CommandRunner added in v0.1.22

type CommandRunner interface {
	Run(ctx context.Context, name string, args ...string) (string, error)
	RunWithTTY(ctx context.Context, name string, args ...string) (string, error)
}

CommandRunner executes shell commands.

type CommitInfo added in v0.1.6

type CommitInfo struct {
	Hash    string
	Author  string
	Date    string
	Message string
}

type MockCommandRunner added in v0.1.22

type MockCommandRunner struct {
	mock.Mock
}

MockCommandRunner is an autogenerated mock type for the CommandRunner type

func NewMockCommandRunner added in v0.1.22

func NewMockCommandRunner(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCommandRunner

NewMockCommandRunner creates a new instance of MockCommandRunner. 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 (*MockCommandRunner) EXPECT added in v0.1.22

func (*MockCommandRunner) Run added in v0.1.22

func (_m *MockCommandRunner) Run(ctx context.Context, name string, args ...string) (string, error)

Run provides a mock function with given fields: ctx, name, args

func (*MockCommandRunner) RunWithTTY added in v0.1.22

func (_m *MockCommandRunner) RunWithTTY(ctx context.Context, name string, args ...string) (string, error)

RunWithTTY provides a mock function with given fields: ctx, name, args

type MockCommandRunner_Expecter added in v0.1.22

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

func (*MockCommandRunner_Expecter) Run added in v0.1.22

func (_e *MockCommandRunner_Expecter) Run(ctx interface{}, name interface{}, args ...interface{}) *MockCommandRunner_Run_Call

Run is a helper method to define mock.On call

  • ctx context.Context
  • name string
  • args ...string

func (*MockCommandRunner_Expecter) RunWithTTY added in v0.1.22

func (_e *MockCommandRunner_Expecter) RunWithTTY(ctx interface{}, name interface{}, args ...interface{}) *MockCommandRunner_RunWithTTY_Call

RunWithTTY is a helper method to define mock.On call

  • ctx context.Context
  • name string
  • args ...string

type MockCommandRunner_RunWithTTY_Call added in v0.1.22

type MockCommandRunner_RunWithTTY_Call struct {
	*mock.Call
}

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

func (*MockCommandRunner_RunWithTTY_Call) Return added in v0.1.22

func (*MockCommandRunner_RunWithTTY_Call) Run added in v0.1.22

func (*MockCommandRunner_RunWithTTY_Call) RunAndReturn added in v0.1.22

type MockCommandRunner_Run_Call added in v0.1.22

type MockCommandRunner_Run_Call struct {
	*mock.Call
}

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

func (*MockCommandRunner_Run_Call) Return added in v0.1.22

func (*MockCommandRunner_Run_Call) Run added in v0.1.22

func (_c *MockCommandRunner_Run_Call) Run(run func(ctx context.Context, name string, args ...string)) *MockCommandRunner_Run_Call

func (*MockCommandRunner_Run_Call) RunAndReturn added in v0.1.22

type MockService added in v0.1.22

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func NewMockService added in v0.1.22

func NewMockService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockService

NewMockService creates a new instance of MockService. 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 (*MockService) Clone added in v0.1.22

func (_m *MockService) Clone(ctx context.Context, url string, branch string) error

Clone provides a mock function with given fields: ctx, url, branch

func (*MockService) EXPECT added in v0.1.22

func (_m *MockService) EXPECT() *MockService_Expecter

func (*MockService) GetInfo added in v0.1.22

func (_m *MockService) GetInfo(ctx context.Context) (*CommitInfo, error)

GetInfo provides a mock function with given fields: ctx

func (*MockService) GetRemote added in v0.1.22

func (_m *MockService) GetRemote(ctx context.Context) (string, error)

GetRemote provides a mock function with given fields: ctx

func (*MockService) GetTopLevel added in v0.1.22

func (_m *MockService) GetTopLevel(ctx context.Context) (string, error)

GetTopLevel provides a mock function with given fields: ctx

func (*MockService) Pull added in v0.1.22

func (_m *MockService) Pull(ctx context.Context) error

Pull provides a mock function with given fields: ctx

func (*MockService) SetLocalExclude added in v0.1.22

func (_m *MockService) SetLocalExclude(patterns []string) error

SetLocalExclude provides a mock function with given fields: patterns

func (*MockService) Sync added in v0.1.22

func (_m *MockService) Sync(ctx context.Context, url string, branch string, sparseCheckout []string) error

Sync provides a mock function with given fields: ctx, url, branch, sparseCheckout

type MockService_Clone_Call added in v0.1.22

type MockService_Clone_Call struct {
	*mock.Call
}

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

func (*MockService_Clone_Call) Return added in v0.1.22

func (*MockService_Clone_Call) Run added in v0.1.22

func (_c *MockService_Clone_Call) Run(run func(ctx context.Context, url string, branch string)) *MockService_Clone_Call

func (*MockService_Clone_Call) RunAndReturn added in v0.1.22

type MockService_Expecter added in v0.1.22

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

func (*MockService_Expecter) Clone added in v0.1.22

func (_e *MockService_Expecter) Clone(ctx interface{}, url interface{}, branch interface{}) *MockService_Clone_Call

Clone is a helper method to define mock.On call

  • ctx context.Context
  • url string
  • branch string

func (*MockService_Expecter) GetInfo added in v0.1.22

func (_e *MockService_Expecter) GetInfo(ctx interface{}) *MockService_GetInfo_Call

GetInfo is a helper method to define mock.On call

  • ctx context.Context

func (*MockService_Expecter) GetRemote added in v0.1.22

func (_e *MockService_Expecter) GetRemote(ctx interface{}) *MockService_GetRemote_Call

GetRemote is a helper method to define mock.On call

  • ctx context.Context

func (*MockService_Expecter) GetTopLevel added in v0.1.22

func (_e *MockService_Expecter) GetTopLevel(ctx interface{}) *MockService_GetTopLevel_Call

GetTopLevel is a helper method to define mock.On call

  • ctx context.Context

func (*MockService_Expecter) Pull added in v0.1.22

func (_e *MockService_Expecter) Pull(ctx interface{}) *MockService_Pull_Call

Pull is a helper method to define mock.On call

  • ctx context.Context

func (*MockService_Expecter) SetLocalExclude added in v0.1.22

func (_e *MockService_Expecter) SetLocalExclude(patterns interface{}) *MockService_SetLocalExclude_Call

SetLocalExclude is a helper method to define mock.On call

  • patterns []string

func (*MockService_Expecter) Sync added in v0.1.22

func (_e *MockService_Expecter) Sync(ctx interface{}, url interface{}, branch interface{}, sparseCheckout interface{}) *MockService_Sync_Call

Sync is a helper method to define mock.On call

  • ctx context.Context
  • url string
  • branch string
  • sparseCheckout []string

type MockService_GetInfo_Call added in v0.1.22

type MockService_GetInfo_Call struct {
	*mock.Call
}

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

func (*MockService_GetInfo_Call) Return added in v0.1.22

func (*MockService_GetInfo_Call) Run added in v0.1.22

func (*MockService_GetInfo_Call) RunAndReturn added in v0.1.22

type MockService_GetRemote_Call added in v0.1.22

type MockService_GetRemote_Call struct {
	*mock.Call
}

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

func (*MockService_GetRemote_Call) Return added in v0.1.22

func (*MockService_GetRemote_Call) Run added in v0.1.22

func (*MockService_GetRemote_Call) RunAndReturn added in v0.1.22

type MockService_GetTopLevel_Call added in v0.1.22

type MockService_GetTopLevel_Call struct {
	*mock.Call
}

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

func (*MockService_GetTopLevel_Call) Return added in v0.1.22

func (*MockService_GetTopLevel_Call) Run added in v0.1.22

func (*MockService_GetTopLevel_Call) RunAndReturn added in v0.1.22

type MockService_Pull_Call added in v0.1.22

type MockService_Pull_Call struct {
	*mock.Call
}

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

func (*MockService_Pull_Call) Return added in v0.1.22

func (*MockService_Pull_Call) Run added in v0.1.22

func (*MockService_Pull_Call) RunAndReturn added in v0.1.22

func (_c *MockService_Pull_Call) RunAndReturn(run func(context.Context) error) *MockService_Pull_Call

type MockService_SetLocalExclude_Call added in v0.1.22

type MockService_SetLocalExclude_Call struct {
	*mock.Call
}

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

func (*MockService_SetLocalExclude_Call) Return added in v0.1.22

func (*MockService_SetLocalExclude_Call) Run added in v0.1.22

func (*MockService_SetLocalExclude_Call) RunAndReturn added in v0.1.22

type MockService_Sync_Call added in v0.1.22

type MockService_Sync_Call struct {
	*mock.Call
}

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

func (*MockService_Sync_Call) Return added in v0.1.22

func (*MockService_Sync_Call) Run added in v0.1.22

func (_c *MockService_Sync_Call) Run(run func(ctx context.Context, url string, branch string, sparseCheckout []string)) *MockService_Sync_Call

func (*MockService_Sync_Call) RunAndReturn added in v0.1.22

type Service added in v0.1.22

type Service interface {
	Clone(ctx context.Context, url, branch string) error
	SetLocalExclude(patterns []string) error
	Sync(ctx context.Context, url, branch string, sparseCheckout []string) error
	Pull(ctx context.Context) error
	GetInfo(ctx context.Context) (*CommitInfo, error)
	GetRemote(ctx context.Context) (string, error)
	GetTopLevel(ctx context.Context) (string, error)
}

func New

func New(targetFolder string) Service

Jump to

Keyboard shortcuts

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