git

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutHead

func CheckoutHead(dir string, branch string) error

func CheckoutRef

func CheckoutRef(dir string, ref *plumbing.Reference) error

func CheckoutRefName

func CheckoutRefName(dir string, ref *plumbing.Reference) error

func CheckoutTag

func CheckoutTag(dir string, tag string) error

func CleanTagRefName

func CleanTagRefName(refName string) string

func CleanTagReference

func CleanTagReference(tagRef *plumbing.Reference) string

clean the tag ref

func FormatRef

func FormatRef(ref *plumbing.Reference) string

func GetCloneDepth added in v0.1.2

func GetCloneDepth(envVar string) int

GetCloneDepth reads the provided env var and returns an int to be used as git clone depth. Default is 0.

func GetHeadCommit

func GetHeadCommit(dir string) (ref *plumbing.Reference, err error)

func GetLastTag

func GetLastTag(dir string) string

func GetLastTagRef

func GetLastTagRef(dir string) *plumbing.Reference

func WalkRepo

func WalkRepo(s string, d fs.DirEntry, err error) error

Types

type Repository

type Repository struct {
	*git.Repository
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(repo *git.Repository, auth *githttp.BasicAuth, localDir string) *Repository

func (*Repository) FetchUpstreamBranch

func (gr *Repository) FetchUpstreamBranch(branch string) error

func (*Repository) GetLocalDirectory

func (gr *Repository) GetLocalDirectory() string

func (*Repository) GetMergeBase

func (gr *Repository) GetMergeBase(oldest, newest string) (string, error)

func (*Repository) GetModifiedFileNamesBetweenCommits

func (gr *Repository) GetModifiedFileNamesBetweenCommits(oldest, newest string) ([]string, error)

Jump to

Keyboard shortcuts

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