git

package
v0.0.0-...-4bf9601 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(p string) (*os.File, error)

func IsValidRepoUrl

func IsValidRepoUrl(url string) bool

func RepoNameFromUrl

func RepoNameFromUrl(url string) (string, error)

Types

type Git

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

func New

func New(opts ...GitOption) *Git

func (*Git) ApplyCommits

func (g *Git) ApplyCommits(repo *git.Repository, checkoutPath string, commits []*object.Commit, subdir string, outputPathFormatters ...PathFormatterFn) error

ApplyCommits will apply all of the commits to the provided repository.

func (*Git) CheckoutBranch

func (g *Git) CheckoutBranch(repo *git.Repository, ref string, create bool) error

func (*Git) CloneRepo

func (g *Git) CloneRepo(repoUrl string, dir string) (*git.Repository, string, error)

func (*Git) CommitsForBranch

func (g *Git) CommitsForBranch(repo *git.Repository, ref string, path *string) ([]*object.Commit, *object.Commit, error)

func (*Git) OpenRepo

func (g *Git) OpenRepo(repoPath string) (*git.Repository, error)

func (*Git) Push

func (g *Git) Push(repo *git.Repository, branch string) error

Push the current branch up to the origin

type GitOption

type GitOption func(*Git)

func BasicAuthPassword

func BasicAuthPassword(pass string) GitOption

func BasicAuthUsername

func BasicAuthUsername(user string) GitOption

func PrivateKeyPassphrase

func PrivateKeyPassphrase(password string) GitOption

func PrivateKeyPath

func PrivateKeyPath(p string) GitOption

func SshUsername

func SshUsername(user string) GitOption

type PathFormatterFn

type PathFormatterFn func(path string) (string, error)

Jump to

Keyboard shortcuts

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