git

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchOptions

type FetchOptions struct {
	Filter     string
	FetchDepth int
}

type GitCLI

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

GitCLI maintains a context for interacting with the Git command line executable.

func NewGitCLI

func NewGitCLI(ctx context.Context) (*GitCLI, error)

NewGitCLI creates a new GitCLI instance

func (*GitCLI) AddConfigBool

func (g *GitCLI) AddConfigBool(global bool, key string, val bool) error

func (*GitCLI) AddConfigInt

func (g *GitCLI) AddConfigInt(global bool, key string, val int64) error

func (*GitCLI) AddConfigStr

func (g *GitCLI) AddConfigStr(global bool, key string, val string) error

func (*GitCLI) BranchDelete

func (g *GitCLI) BranchDelete(remote bool, branch string) error

func (*GitCLI) BranchExists

func (g *GitCLI) BranchExists(remote bool, pattern string) (bool, error)

func (*GitCLI) BranchGetDefault

func (g *GitCLI) BranchGetDefault(repositoryUrl string) (string, error)

func (*GitCLI) BranchList

func (g *GitCLI) BranchList(remote bool) ([]string, error)

func (*GitCLI) Checkout

func (g *GitCLI) Checkout(ref string, startPoint string) error

func (*GitCLI) CheckoutDetach

func (g *GitCLI) CheckoutDetach() error

CheckoutDetach detaches the current working directory if it is part of a git workspace.

func (*GitCLI) Clean

func (g *GitCLI) Clean() error

func (*GitCLI) Cwd

func (g *GitCLI) Cwd() string

Cwd returns the current working directory used by the GitCLI

func (*GitCLI) Executable

func (g *GitCLI) Executable() string

func (*GitCLI) Fetch

func (g *GitCLI) Fetch(refSpec []string, options FetchOptions) error

func (*GitCLI) GetAllConfig

func (g *GitCLI) GetAllConfig(global bool, key string) ([]string, error)

func (*GitCLI) GetConfig

func (g *GitCLI) GetConfig(global bool, key string) (string, error)

func (*GitCLI) GlobalConfigPath

func (g *GitCLI) GlobalConfigPath() (string, error)

GlobalConfigPath returns the path of the global configuration file

func (*GitCLI) Init

func (g *GitCLI) Init(path string) error

func (*GitCLI) IsDetached

func (g *GitCLI) IsDetached() (bool, error)

IsDetached returns true if the current working directory is part of a git workspace that is in a detached head state

func (*GitCLI) LfsFetch

func (g *GitCLI) LfsFetch(ref string) error

func (*GitCLI) LfsInstall

func (g *GitCLI) LfsInstall() error

func (*GitCLI) Log1

func (g *GitCLI) Log1(format ...string) (string, error)

func (*GitCLI) RemoteAdd

func (g *GitCLI) RemoteAdd(name string, url string) error

func (*GitCLI) Reset

func (g *GitCLI) Reset() error

func (*GitCLI) RevParse

func (g *GitCLI) RevParse(ref string) (string, error)

func (*GitCLI) SetConfigBool

func (g *GitCLI) SetConfigBool(global bool, key string, val bool) error

func (*GitCLI) SetConfigInt

func (g *GitCLI) SetConfigInt(global bool, key string, val int64) error

func (*GitCLI) SetConfigStr

func (g *GitCLI) SetConfigStr(global bool, key string, val string) error

func (*GitCLI) SetCwd

func (g *GitCLI) SetCwd(cwd string)

SetCwd sets the current working directory used by the GitCLI

func (*GitCLI) SetEnv

func (g *GitCLI) SetEnv(key string, val string)

SetEnv sets the environment variable for the GitCLI

func (*GitCLI) ShaExists

func (g *GitCLI) ShaExists(sha string) (bool, error)

func (*GitCLI) SparseCheckout

func (g *GitCLI) SparseCheckout(dirs []string) error

func (*GitCLI) SparseCheckoutNonConeMode

func (g *GitCLI) SparseCheckoutNonConeMode(patterns []string) (err error)

func (*GitCLI) SubmoduleForeach

func (g *GitCLI) SubmoduleForeach(recursive bool, cmd ...string) (string, error)

func (*GitCLI) SubmoduleStatus

func (g *GitCLI) SubmoduleStatus() error

func (*GitCLI) SubmoduleSync

func (g *GitCLI) SubmoduleSync(recursive bool) error

func (*GitCLI) SubmoduleUpdate

func (g *GitCLI) SubmoduleUpdate(fetchDepth int, recursive bool) error

func (*GitCLI) TagExists

func (g *GitCLI) TagExists(pattern string) (bool, error)

func (*GitCLI) UnsetConfig

func (g *GitCLI) UnsetConfig(global bool, key string) (bool, error)

Jump to

Keyboard shortcuts

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