gitutil

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGitHubProjectForOrigin

func GetGitHubProjectForOrigin(dir string) (string, string, error)

GetGitHubProjectForOrigin returns the GitHub login, and GitHub repo name if the "origin" remote is a GitHub URL.

func GetGitHubProjectForOriginByRepo

func GetGitHubProjectForOriginByRepo(repo *git.Repository) (string, string, error)

GetGitHubProjectForOriginByRepo returns the GitHub login, and GitHub repo name if the "origin" remote is a GitHub URL.

func GetGitReferenceNameOrHashAndSubDirectory added in v0.15.0

func GetGitReferenceNameOrHashAndSubDirectory(url string, urlPath string) (
	plumbing.ReferenceName, plumbing.Hash, string, error)

GetGitReferenceNameOrHashAndSubDirectory returns the reference name or hash, and sub directory path. The sub directory path always uses "/" as the separator.

func GetGitRepository

func GetGitRepository(dir string) (*git.Repository, error)

GetGitRepository returns the git repository by walking up from the provided directory. If no repository is found, will return (nil, nil).

func GitCloneAndCheckoutCommit added in v0.15.0

func GitCloneAndCheckoutCommit(url string, commit plumbing.Hash, path string) error

GitCloneAndCheckoutCommit clones the Git repository and checkouts the specified commit.

func GitCloneOrPull added in v0.15.0

func GitCloneOrPull(url string, referenceName plumbing.ReferenceName, path string, shallow bool) error

GitCloneOrPull clones or updates the specified referenceName (branch or tag) of a Git repository.

func GitListBranchesAndTags added in v0.15.0

func GitListBranchesAndTags(url string) ([]plumbing.ReferenceName, error)

GitListBranchesAndTags fetches a remote Git repository's branch and tag references (including HEAD), sorted by the length of the short name descending.

func ParseGitRepoURL added in v0.15.0

func ParseGitRepoURL(rawurl string) (string, string, error)

ParseGitRepoURL returns the URL to the Git repository and path from a raw URL. For example, an input of "https://github.com/pulumi/templates/templates/javascript" returns "https://github.com/pulumi/templates.git" and "templates/javascript".

Types

This section is empty.

Jump to

Keyboard shortcuts

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