git

package
v0.18.6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutCommit added in v0.12.0

func CheckoutCommit(target string, commit string) error

func CheckoutTag added in v0.18.1

func CheckoutTag(target, name string) error

func Clone

func Clone(src string, dst string) error

func CloneOrPull added in v0.12.0

func CloneOrPull(src string, dst string) error

func GitUrlInfo added in v0.12.0

func GitUrlInfo(url string) (*vcsurl.VCS, error)

func IsValidGitUrl

func IsValidGitUrl(url string) bool

func ParseGitUrl

func ParseGitUrl(url string) (*url.URL, error)

func Pull

func Pull(dst string) error

func RepoLastCommit added in v0.12.0

func RepoLastCommit(src string) (string, error)

func RepoRemoteUrl added in v0.12.0

func RepoRemoteUrl(src string) (string, error)

func SortRepoInfo added in v0.16.2

func SortRepoInfo(infos []*RepoInfo)

Types

type RepoInfo added in v0.16.0

type RepoInfo struct {
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Author      string            `json:"author"`
	Path        string            `json:"path"`
	Git         string            `json:"git"`
	Commit      string            `json:"commit"`
	Latest      VersionInfo       `json:"latest"`
	Versions    VersionCollection `json:"tags"`
	InCache     bool              `json:"inCache"`
	InRegistry  bool              `json:"inRegistry"`
}

func RemoteRepoInfo added in v0.12.0

func RemoteRepoInfo(url string) (RepoInfo, error)

type VersionCollection added in v0.12.0

type VersionCollection []VersionInfo

VersionCollection is a collection of tags it implements sort.Interface

func (VersionCollection) AsList added in v0.16.2

func (c VersionCollection) AsList() []string

func (VersionCollection) Latest added in v0.12.0

func (c VersionCollection) Latest() VersionInfo

Latest returns the latest tag info

func (VersionCollection) Len added in v0.12.0

func (c VersionCollection) Len() int

Len is the number of elements in the collection.

func (VersionCollection) Less added in v0.12.0

func (c VersionCollection) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (VersionCollection) Swap added in v0.12.0

func (c VersionCollection) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type VersionInfo added in v0.12.0

type VersionInfo struct {
	Name    string          `json:"name"`
	SHA     string          `json:"sha"`
	Version *semver.Version `json:"version"`
}

VersionInfo contains information about a tag

Jump to

Keyboard shortcuts

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