git

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 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 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)

Types

type RemoteInfo added in v0.12.0

type RemoteInfo 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      string            `json:"latest"`
	Versions    VersionCollection `json:"tags"`
}

func RemoteRepoInfo added in v0.12.0

func RemoteRepoInfo(url string) (RemoteInfo, error)

type VersionCollection added in v0.12.0

type VersionCollection []VersionInfo

VersionCollection is a collection of tags it implements sort.Interface

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