Documentation ¶
Index ¶
- func CreateTag(dir, tag string) error
- func FindForkPoint(repo *git.Repository, branchRef, upstreamRef *plumbing.Reference) (*plumbing.Hash, error)
- func GetGitAuth(gitURL string) (*gitHttp.BasicAuth, error)
- func GetGitAuthorSignature() *object.Signature
- func GetVersionFromTag(dir string, index int) (*version.Version, error)
- func PushTag(dir, tagName string) error
- func SetGitSignOptions(repoPath string) error
- func TempClone(gitURL, hash string, useAuth bool) (repoDir string, err error)
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindForkPoint ¶ added in v0.9.0
func FindForkPoint(repo *git.Repository, branchRef, upstreamRef *plumbing.Reference) (*plumbing.Hash, error)
FindForkPoint finds the fork point between the local branch and the upstream branch.
The fork point is the commit hash of the latest commit had in common between the local branch and the upstream branch.
The local branch is the branch pointed to by the provided branchRef.
The upstream branch is the branch pointed to by the provided upstreamRef.
The caller is responsible for closing the provided repo.
func GetGitAuthorSignature ¶
func GetVersionFromTag ¶
GetVersionFromTag sorts git tags and returns the provided index e.g. index=1 will return the most recent tag
func SetGitSignOptions ¶
func TempClone ¶ added in v0.9.0
TempClone clones the repo using the provided HTTPS URL to a temp directory, and returns the path to the temp directory.
If hash is non-empty, the repo will be checked out to that commit hash.
If user authentication is requested, a personal access token will be read in from the GITHUB_TOKEN environment variable.
The caller is responsible for cleaning up the temp directory.
Types ¶
type URL ¶
func GetRemoteURL ¶
func GetRemoteURLFromDir ¶
func ParseGitURL ¶
ParseGitURL returns owner, repo name, errors