git

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitUtil

type GitUtil struct {
	RepoPath string
}

GitUtil allows for fetching information about a Git repository using Git CLI commands.

func (*GitUtil) CommitLog added in v0.2.0

func (g *GitUtil) CommitLog(hash string) (string, error)

CommitLog returns the log of the specified commit, including a list of the files that were modified.

func (*GitUtil) HeadHash

func (g *GitUtil) HeadHash() (string, error)

HeadHash returns the hash of the current HEAD commit.

func (*GitUtil) ListAllFiles added in v0.2.0

func (g *GitUtil) ListAllFiles() ([]string, error)

ListAllFiles returns a list of all files under $REPO_PATH, with paths relative to $REPO_PATH.

func (*GitUtil) ListDiffFiles added in v0.2.0

func (g *GitUtil) ListDiffFiles(oldHash, newHash string) ([]string, error)

ListDiffFiles returns the file names that were added, modified, copied, or renamed. Deletes are ignored because kube-applier should not apply files deleted by a commit.

type GitUtilInterface

type GitUtilInterface interface {
	HeadHash() (string, error)
	ListAllFiles() ([]string, error)
	CommitLog(string) (string, error)
	ListDiffFiles(string, string) ([]string, error)
}

GitUtilInterface allows for mocking out the functionality of GitUtil when testing the full process of an apply run.

type MockGitUtilInterface

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

MockGitUtilInterface is a mock of GitUtilInterface interface

func NewMockGitUtilInterface

func NewMockGitUtilInterface(ctrl *gomock.Controller) *MockGitUtilInterface

NewMockGitUtilInterface creates a new mock instance

func (*MockGitUtilInterface) CommitLog added in v0.2.0

func (_m *MockGitUtilInterface) CommitLog(_param0 string) (string, error)

CommitLog mocks base method

func (*MockGitUtilInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockGitUtilInterface) HeadHash

func (_m *MockGitUtilInterface) HeadHash() (string, error)

HeadHash mocks base method

func (*MockGitUtilInterface) ListAllFiles added in v0.2.0

func (_m *MockGitUtilInterface) ListAllFiles() ([]string, error)

ListAllFiles mocks base method

func (*MockGitUtilInterface) ListDiffFiles added in v0.2.0

func (_m *MockGitUtilInterface) ListDiffFiles(_param0 string, _param1 string) ([]string, error)

ListDiffFiles mocks base method

type MockGitUtilInterfaceMockRecorder added in v0.2.0

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

MockGitUtilInterfaceMockRecorder is the mock recorder for MockGitUtilInterface

func (*MockGitUtilInterfaceMockRecorder) CommitLog added in v0.2.0

func (_mr *MockGitUtilInterfaceMockRecorder) CommitLog(arg0 interface{}) *gomock.Call

CommitLog indicates an expected call of CommitLog

func (*MockGitUtilInterfaceMockRecorder) HeadHash added in v0.2.0

func (_mr *MockGitUtilInterfaceMockRecorder) HeadHash() *gomock.Call

HeadHash indicates an expected call of HeadHash

func (*MockGitUtilInterfaceMockRecorder) ListAllFiles added in v0.2.0

func (_mr *MockGitUtilInterfaceMockRecorder) ListAllFiles() *gomock.Call

ListAllFiles indicates an expected call of ListAllFiles

func (*MockGitUtilInterfaceMockRecorder) ListDiffFiles added in v0.2.0

func (_mr *MockGitUtilInterfaceMockRecorder) ListDiffFiles(arg0, arg1 interface{}) *gomock.Call

ListDiffFiles indicates an expected call of ListDiffFiles

Jump to

Keyboard shortcuts

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