git

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package git implements helpers for interacting with git

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoHeadBranch is returned when a repository's HEAD (aka default) branch cannot
	// be determine
	ErrNoHeadBranch = errors.New("failed to find a head branch, does one exist?")

	// ErrNoRemoteHeadBranch is returned when a repository's remote  default/HEAD branch
	// cannot be determined.
	ErrNoRemoteHeadBranch = errors.New("failed to get head branch from remote origin")
)

This block contains errors and regexes

Functions

func Clone added in v0.7.0

func Clone(ctx context.Context, ref, url string) (string, error)

Clone clone a git repository to a temporary directory and returns the path to the repository. If ref is empty, the default branch will be used.

func GetDefaultBranch

func GetDefaultBranch(ctx context.Context, path string) (string, error)

GetDefaultBranch determines the default/HEAD branch for a given git repository.

func ListRemote added in v0.7.0

func ListRemote(ctx context.Context, remote string) ([][]string, error)

ListRemote returns a list of all remotes as shown from running 'git ls-remote'.

Types

This section is empty.

Directories

Path Synopsis
vcs
github
Package github provides methods for creating a Github client for the purposes of interacting with the API.
Package github provides methods for creating a Github client for the purposes of interacting with the API.

Jump to

Keyboard shortcuts

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