Versions in this module Expand all Collapse all v0 v0.19.3 Oct 23, 2025 v0.19.0 Sep 30, 2025 Changes in this version + const GitProtocol + const HTTPProtocol + const HTTPSProtocol + const SSHProtocol + var ErrInvalidProtocol = errors.New("invalid protocol") + var ErrUnknownProtocol = errors.New("unknown protocol") + func IsGitTransport(remote string) bool + type GitCLI struct + func NewGitCLI(opts ...Option) *GitCLI + func (cli *GitCLI) Dir() string + func (cli *GitCLI) GitDir(ctx context.Context) (string, error) + func (cli *GitCLI) New(opts ...Option) *GitCLI + func (cli *GitCLI) Run(ctx context.Context, args ...string) (_ []byte, err error) + func (cli *GitCLI) WorkTree(ctx context.Context) (string, error) + type GitRef struct + Commit string + IndistinguishableFromLocal bool + Remote string + ShortName string + SubDir string + UnencryptedTCP bool + func ParseGitRef(ref string) (*GitRef, error) + type GitURL struct + Fragment *GitURLFragment + Host string + Path string + Remote string + Scheme string + User *url.Userinfo + func ParseURL(remote string) (*GitURL, error) + type GitURLFragment struct + Ref string + Subdir string + type Option func(b *GitCLI) + func WithArgs(args ...string) Option + func WithDir(dir string) Option + func WithExec(exec func(context.Context, *exec.Cmd) error) Option + func WithGitBinary(path string) Option + func WithGitDir(gitDir string) Option + func WithSSHAuthSock(sshAuthSock string) Option + func WithSSHKnownHosts(sshKnownHosts string) Option + func WithStreams(streams StreamFunc) Option + func WithWorkTree(workTree string) Option + type StreamFunc func(context.Context) (io.WriteCloser, io.WriteCloser, func())