Documentation
¶
Index ¶
- type CLIGit
- func (g *CLIGit) Add() error
- func (g *CLIGit) Clone(repo, branch, location string) error
- func (g *CLIGit) Commit() error
- func (g *CLIGit) CreateBranch() error
- func (g *CLIGit) CreateRepository() error
- func (g *CLIGit) HasChanges() (bool, error)
- func (g *CLIGit) IsRepository() error
- func (g *CLIGit) Push() error
- func (g *CLIGit) SparseClone(repo, branch, location, path string) error
- type CLIGitConfig
- type Client
- type Git
- type SCMClient
- type SCMConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLIGit ¶
type CLIGit struct {
CLIGitConfig
Runner runner.Runner
}
CLIGit is a new command line based Git.
func NewCLIGit ¶
func NewCLIGit(cfg CLIGitConfig, r runner.Runner) *CLIGit
NewCLIGit creates a new command line based Git.
func (*CLIGit) Clone ¶ added in v0.0.3
Clone will take a repo location and clone it into a given folder.
func (*CLIGit) CreateBranch ¶
CreateBranch creates a branch if it differs from the base.
func (*CLIGit) CreateRepository ¶
CreateRepository bootstraps a plain repository at a given location.
func (*CLIGit) HasChanges ¶
HasChanges returns whether a location has uncommitted changes or not.
func (*CLIGit) IsRepository ¶
IsRepository returns whether a location is a git repository or not.
func (*CLIGit) SparseClone ¶ added in v0.0.3
SparseClone will take a repo location and clone it into a given folder using sparse clone. This might take a bit longer initially, but is much more performant in case of a mono profiles repository.
type CLIGitConfig ¶
CLIGitConfig defines configuration options for CLIGit.
type Client ¶
type Client struct {
SCMConfig
}
Client defines a client which uses a real implementation to create pull requests.
func (*Client) CreatePullRequest ¶
CreatePullRequest will create a pull request.
type Git ¶
type Git interface {
// Add staged changes.
Add() error
// Commit changes.
Commit() error
// CreateBranch create a branch if it's needed.
CreateBranch() error
// CreateRepository bootstraps a plain repository at a given location.
CreateRepository() error
// IsRepository returns whether a location is a git repository or not.
IsRepository() error
// HasChanges returns whether a location has uncommitted changes or not.
HasChanges() (bool, error)
// Push will push to a remote.
Push() error
// Clone will take a repo location and clone it into a given folder.
Clone(repo, branch, location string) error
// SparseClone will take a repo location and clone it into a given folder.
SparseClone(repo, branch, location, path string) error
}
Git defines high level abilities for Git related operations.