git

package
v0.1.0-alpha6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package git defines the functionality to interact with the git CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git interface {
	// DiffDirsAbs returns the directories changed using the git diff command
	DiffDirsAbs(ctx context.Context, baseRef, headRef string) ([]string, error)
}

Git defined the common git functionality.

type GitClient

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

GitClient implements the git interface.

func NewGitClient

func NewGitClient(workingDir string) *GitClient

NewGitClient creates a new Terraform client.

func (*GitClient) DiffDirsAbs

func (g *GitClient) DiffDirsAbs(ctx context.Context, ref1, ref2 string) ([]string, error)

DiffDirsAbs runs a git diff between two revisions and returns the sorted list of absolute directory paths that have changes.

type MockGitClient

type MockGitClient struct {
	DiffResp []string
	DiffErr  error
}

MockGitClient implements the git interface.

func (*MockGitClient) DiffDirsAbs

func (m *MockGitClient) DiffDirsAbs(ctx context.Context, baseRef, headRef string) ([]string, error)

DiffDirsAbs runs a git diff between two revisions and returns the list of directories with changes.

Jump to

Keyboard shortcuts

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