git

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package git simplifies git operations

Index

Constants

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

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 Prune added in v0.1.4

func Prune(local string) (updated bool, 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 AncestralTag added in v0.4.0

type AncestralTag struct {
	Tag
	Depth int
}

type Repo

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

func Clone

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

func CloneMirrored added in v0.1.4

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

func Open added in v0.1.4

func Open(local string) (*Repo, error)

func (*Repo) Checkout

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

func (*Repo) FetchAll added in v0.6.0

func (r *Repo) FetchAll() error

func (*Repo) GetAncestralTags added in v0.4.0

func (r *Repo) GetAncestralTags(commit string) ([]AncestralTag, error)

func (*Repo) GetCommitFullHash added in v0.1.4

func (r *Repo) GetCommitFullHash(commit string) (string, error)

func (*Repo) GetCommitTime

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

func (*Repo) GetTags added in v0.4.0

func (r *Repo) GetTags() ([]Tag, error)

func (*Repo) GetTagsAt added in v0.4.0

func (r *Repo) GetTagsAt(commit string) ([]Tag, error)

func (*Repo) MakeTrackingBranches added in v0.6.0

func (r *Repo) MakeTrackingBranches(remoteName string) error

func (*Repo) Refs added in v0.1.4

func (r *Repo) Refs() (refs []*plumbing.Reference, err error)

func (*Repo) SetRemoteURLs added in v0.6.0

func (r *Repo) SetRemoteURLs(remoteName string, urls []string) error

type Tag added in v0.4.0

type Tag struct {
	Name string
	Hash plumbing.Hash
}

func (Tag) GetName added in v0.4.0

func (t Tag) GetName() string

Jump to

Keyboard shortcuts

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