git

package
v0.0.0-...-9bedb10 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseGitStatus

func ParseGitStatus(status string) (added, removed, modified []string)

Types

type Git

type Git interface {
	Status() (string, error)
	Commit(val string) (string, error)
	GitDir() (string, error)
	DiffNames() (string, error)
	DiffFile(file string) (string, error)
	ShowDeletedFile(file string) (string, error)
	InstallHook() error
	UninstallHook() error
}

func New

func New(opts ...Option) Git

type GitOperation

type GitOperation string
const (
	OPERATION_ADD GitOperation = "A"
	OPERATION_DEL GitOperation = "D"
	OPERATION_MOD GitOperation = "M"
)

type Option

type Option func(*config)

func WithDiffUnified

func WithDiffUnified(val int) Option

WithDiffUnified is a function that generate diffs with <n> lines of context instead of the usual three.

func WithExcludeList

func WithExcludeList(val []string) Option

WithExcludeList returns an Option that sets the excludeList field of a config object to the given value.

Jump to

Keyboard shortcuts

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