Documentation
¶
Index ¶
- Variables
- func FindGitRef(ctx context.Context, file string) (string, error)
- func FindGitRevision(ctx context.Context, file string) (shortSha, sha string, err error)
- func FindGithubRepo(ctx context.Context, file, githubInstance, remoteName string) (string, error)
- type CloneInput
- type Error
- type Worktree
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrShortRef = errors.New("short SHA references are not supported") ErrNoRepo = errors.New("unable to find git repo") )
Functions ¶
func FindGitRef ¶
FindGitRef get the current git ref
func FindGitRevision ¶
FindGitRevision get the current git revision
Types ¶
type CloneInput ¶
type CloneInput struct {
CacheDir string // parent-location for all git caches that the runner maintains
URL string // url of the remote to clone
Ref string // reference from the remote; eg. tag, branch, or sha
Token string // authentication token
OfflineMode bool // when true, no remote operations will occur
InsecureSkipTLS bool // when true, TLS verification will be skipped on remote operations
}
CloneInput is a parameter struct for the method `Clone` to simplify the multiple parameters required.
type Worktree ¶
type Worktree interface {
io.Closer
WorktreeDir() string // fully qualified path to the work tree for this repo
}
func Clone ¶
func Clone(ctx context.Context, input CloneInput) (Worktree, error)
Clones a git repo. The repo contents are stored opaquely in the provided `CacheDir`, and may be reused by future clone operations. The returned value contains a path to the working tree that can be used to interact with the requested ref; it must be closed to indicate operations against it are complete.
Click to show internal directories.
Click to hide internal directories.