git

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(ctx context.Context, repoURL, token, ref string) (dir string, commitSHA string, cleanup func(), err error)

Clone clones a git repository over HTTPS into a temporary directory. Returns the directory path, resolved HEAD commit SHA, a cleanup function, and any error.

The repoURL may embed a branch via the path (e.g. github.com/org/repo.git/mybranch). If ref is non-empty it overrides any branch embedded in the URL. If token is empty, Clone tries anonymous clone before retrying with GITHUB_AUTH_TOKEN.

func IsGitRepoURL

func IsGitRepoURL(repoURL string) bool

IsGitRepoURL returns true if the URL points to a git repository on a known hosting platform (GitHub, GitLab) or ends with ".git".

func ResolveToken

func ResolveToken(token string) string

ResolveToken returns token if non-empty, otherwise falls back to GITHUB_AUTH_TOKEN env var.

Types

This section is empty.

Jump to

Keyboard shortcuts

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