git

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	Fs        afero.Fs
	HooksPath string
	RootPath  string
	GitPath   string
}

Repository represents a git repository.

func NewRepository

func NewRepository(fs afero.Fs) (*Repository, error)

NewRepository returns a Repository or an error, if git repository it not initialized.

func (*Repository) AllFiles

func (r *Repository) AllFiles() ([]string, error)

StagedFiles returns a list of all files in repository or an error if git command fails.

func (*Repository) FilesByCommand added in v1.0.4

func (r *Repository) FilesByCommand(command string) ([]string, error)

FilesByCommand accepts git command and returns its result as a list of filepaths.

func (*Repository) PushFiles

func (r *Repository) PushFiles() ([]string, error)

PushFiles returns a list of files that are ready to be pushed or an error if git command fails.

func (*Repository) StagedFiles

func (r *Repository) StagedFiles() ([]string, error)

StagedFiles returns a list of staged files or an error if git command fails.

func (*Repository) State

func (r *Repository) State() State

type State

type State string
const (
	NilState    State = ""
	MergeState  State = "merge"
	RebaseState State = "rebase"
)

Jump to

Keyboard shortcuts

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