git

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchModifiedError

type BranchModifiedError struct {
	Checksums []string
}

func (*BranchModifiedError) Error

func (e *BranchModifiedError) Error() string

type EmptyRepositoryError added in v0.11.1

type EmptyRepositoryError struct{}

func (EmptyRepositoryError) Error added in v0.11.1

func (e EmptyRepositoryError) Error() string

type Git

type Git struct {
	CmdExec             func(*exec.Cmd) error // exists to mock calls in unit tests
	EnvVars             []string
	MetricCommandsCount *prometheus.CounterVec
	MetricCommandsSum   *prometheus.CounterVec
	// contains filtered or unexported fields
}

func New

func New(opts options.Opts) (*Git, error)

func (*Git) Cleanup added in v0.18.0

func (g *Git) Cleanup(repo host.Repository) error

func (*Git) CommitChanges

func (g *Git) CommitChanges(msg string) error

func (*Git) Execute

func (g *Git) Execute(arg ...string) (string, string, error)

func (*Git) HasLocalChanges

func (g *Git) HasLocalChanges() (bool, error)

func (*Git) HasRemoteChanges

func (g *Git) HasRemoteChanges(branchName string) (bool, error)

func (*Git) Prepare

func (g *Git) Prepare(repo host.Repository, retry bool) (string, error)

func (*Git) Push

func (g *Git) Push(branchName string) error

func (*Git) UpdateTaskBranch

func (g *Git) UpdateTaskBranch(branchName string, forceRebase bool, repo host.Repository) (bool, error)

type GitClient

type GitClient interface {
	Cleanup(repo host.Repository) error
	CommitChanges(msg string) error
	Execute(arg ...string) (string, string, error)
	HasLocalChanges() (bool, error)
	HasRemoteChanges(branchName string) (bool, error)
	Prepare(repo host.Repository, retry bool) (string, error)
	Push(branchName string) error
	UpdateTaskBranch(branchName string, forceRebase bool, repo host.Repository) (bool, error)
}

type GitCommandError

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

func (*GitCommandError) Error

func (e *GitCommandError) Error() string

func (*GitCommandError) Unwrap

func (e *GitCommandError) Unwrap() error

Jump to

Keyboard shortcuts

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