git

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package git simplifies git operations

Index

Constants

View Source
const (
	StatusUnmodified = git.Unmodified
	StatusRenamed    = git.Renamed
)

Variables

View Source
var ErrRepositoryAlreadyExists = git.ErrRepositoryAlreadyExists

Functions

func AbbreviateHash added in v0.1.3

func AbbreviateHash(h plumbing.Hash) string

func AnnotateRefName added in v0.1.3

func AnnotateRefName(name plumbing.ReferenceName) string

func EmptyListOptions added in v0.1.3

func EmptyListOptions() *git.ListOptions

func Fetch

func Fetch(local string) (updated bool, err error)

func FilterBranches added in v0.1.3

func FilterBranches(refs []*plumbing.Reference) []*plumbing.Reference

func FilterRemotes added in v0.1.3

func FilterRemotes(refs []*plumbing.Reference) []*plumbing.Reference

func FilterTags added in v0.1.3

func FilterTags(refs []*plumbing.Reference) []*plumbing.Reference
func Head(local string) (ref *plumbing.Reference, err error)

func ParseRemoteRelease

func ParseRemoteRelease(remoteRelease string) (remote, release string, err error)

func Pull

func Pull(local string) (updated bool, err error)

func Refs added in v0.1.3

func Refs(local string) (refs []*plumbing.Reference, err error)

func Remotes added in v0.1.3

func Remotes(local string) (remotes []*git.Remote, err error)

func Status added in v0.1.3

func Status(local string) (status git.Status, err error)

func StringifyRef added in v0.1.3

func StringifyRef(ref *plumbing.Reference) string

Types

type Repo

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

func Clone

func Clone(remote, local string) (*Repo, error)

func (*Repo) Checkout

func (r *Repo) Checkout(release string) error

func (*Repo) GetCommitTime

func (r *Repo) GetCommitTime(commit string) (time.Time, error)

Jump to

Keyboard shortcuts

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