Documentation
¶
Overview ¶
Package git provides git operations helpers.
Index ¶
- func Checkout(ctx context.Context, repoPath, ref string) error
- func Clone(ctx context.Context, url, dest string) error
- func GetCurrentCommit(ctx context.Context, repoPath string) (string, error)
- func GetLatestTag(ctx context.Context, repoPath string) (string, error)
- func InstallSubdir(ctx context.Context, repoURL, branch, subDir, dest string) error
- func SparseClone(ctx context.Context, repoURL, branch, subDir, dest string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Checkout ¶
Checkout checks out a specific tag or branch. The ref is validated to prevent unexpected git behavior from malformed references.
func Clone ¶
Clone clones a git repository to the specified destination. Only HTTPS URLs are accepted for security.
func GetCurrentCommit ¶ added in v0.2.0
GetCurrentCommit returns the current commit hash of the repository
func GetLatestTag ¶
GetLatestTag returns the latest tag for a repository in the given path
func InstallSubdir ¶
InstallSubdir installs a subdirectory from a repository Uses sparse checkout for efficiency, falls back to full clone if sparse fails
func SparseClone ¶ added in v0.2.0
SparseClone clones only a specific subdirectory using sparse checkout. This is much faster than full clone for large repos when only a subdir is needed. Only HTTPS URLs are accepted for security.
Types ¶
This section is empty.