Documentation
¶
Index ¶
Constants ¶
View Source
const ( RemoteName = "origin" TagPrefix = "refs/tags/" BranchPrefix = "refs/heads/" MainBranch = "refs/heads/main" )
Variables ¶
View Source
var ( ErrCheckoutFailed = errors.New("failed to checkout repository") ErrFetchFailed = errors.New("failed to fetch repository") ErrPullFailed = errors.New("failed to pull repository") ErrRepositoryAlreadyExists = git.ErrRepositoryAlreadyExists ErrInvalidReference = git.ErrInvalidReference )
Functions ¶
func CloneRepository ¶
func CloneRepository(path, url, ref string, skipTLSVerify bool) (*git.Repository, error)
CloneRepository clones a repository from a given URL and reference to a temporary directory
func GetAuthUrl ¶
GetAuthUrl returns a clone URL with an access token for private repositories
func UpdateRepository ¶ added in v0.16.0
func UpdateRepository(path, ref string, skipTLSVerify bool) (*git.Repository, error)
UpdateRepository updates a local repository by
- fetching the latest changes from the remote
- checking out the specified reference (branch or tag)
- pulling the latest changes from the remote
- returning the updated repository
Allowed reference forma
- Branches: refs/heads/main or main
- Tags: refs/tags/v1.0.0 or v1.0.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.