Documentation
¶
Overview ¶
Package git defines the GitRunner interface and a system-git implementation that shells out to the installed git binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner interface {
// LsRemoteTags lists the repo's tags and the commits they point to.
LsRemoteTags(ctx context.Context, url string) ([]TagRef, error)
// ResolveRef resolves a branch, tag, or commit ref to an immutable commit SHA.
ResolveRef(ctx context.Context, url, ref string) (string, error)
// FetchCommit materializes the tree at commit into dest, without a .git dir.
FetchCommit(ctx context.Context, url, commit, dest string) error
}
Runner is the git capability gskill needs. The system implementation shells out to the git binary; the interface lets it be swapped (e.g. go-git) later.
type SystemRunner ¶
type SystemRunner struct{}
SystemRunner implements Runner by shelling out to the system git binary.
func NewSystemRunner ¶
func NewSystemRunner() SystemRunner
NewSystemRunner returns a Runner backed by the system git binary.
func (SystemRunner) FetchCommit ¶
func (SystemRunner) FetchCommit(ctx context.Context, url, commit, dest string) error
FetchCommit materializes the tree at commit into dest with no .git directory.
func (SystemRunner) LsRemoteTags ¶
LsRemoteTags lists tags via "git ls-remote --tags", preferring the peeled (^{}) commit for annotated tags.
func (SystemRunner) ResolveRef ¶
ResolveRef resolves a ref to an immutable commit SHA. A full SHA is returned as-is; otherwise the ref is looked up via "git ls-remote".