git

package
v0.0.0-...-6801fd0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHubURL

func GitHubURL(repoOwner, repoName string) string

nolint:revive // I don't want to call this HubURL

Types

type Git

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

func New

func New() *Git

New returns a new Git object with the default options

func NewWithOptions

func NewWithOptions(opts *Options) *Git

NewWithOptions returns a git object with specific options

func (*Git) CloneRepo

func (g *Git) CloneRepo(url, path string) (repo *Repository, err error)

func (*Git) LsRemote

func (g *Git) LsRemote(args ...string) (string, error)

func (*Git) OpenOrCloneRepo

func (g *Git) OpenOrCloneRepo(url, path string) (repo *Repository, err error)

OpenOrCloneRepo

func (*Git) OpenRepo

func (g *Git) OpenRepo(path string) (repo *Repository, err error)

type Options

type Options struct{}

type RepoOptions

type RepoOptions struct {
	Path          string
	DefaultRemote string
	MergeStrategy string // recursive-theirs
}

type Repository

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

func NewRepository

func NewRepository() *Repository

func NewRepositoryWithOptions

func NewRepositoryWithOptions(opts *RepoOptions) *Repository

func (*Repository) AddRemote

func (repo *Repository) AddRemote(name, url string) error

func (*Repository) Checkout

func (repo *Repository) Checkout(refName string) error

Checkout checks out the reference named `refName` in the repository. Currently works with branches only

func (*Repository) CherryPickCommits

func (repo *Repository) CherryPickCommits(commits []string, targetBranch string) error

CherryPickCommits cherry picks the commits in `commits` to a target branch

func (*Repository) CherryPickMergeCommit

func (repo *Repository) CherryPickMergeCommit(branch, commitSHA string, parent int) error

func (*Repository) CreateBranch

func (repo *Repository) CreateBranch(branchName string) error

func (*Repository) HasMergeConflicts

func (repo *Repository) HasMergeConflicts() (hasConflicts bool, files []string, err error)

HasMergeConflicts returns a bool indicating if a merge conflict is on

func (*Repository) MainRemoteURL

func (repo *Repository) MainRemoteURL() (string, error)

func (*Repository) Options

func (repo *Repository) Options() *RepoOptions

func (*Repository) PushBranch

func (repo *Repository) PushBranch(branch, remote string) error

func (*Repository) SetClient

func (repo *Repository) SetClient(c *gogit.Repository)

Jump to

Keyboard shortcuts

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