gitexec

package
v0.10.257 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gitexec runs authenticated, non-interactive Git commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client runs Git with host-scoped HTTPS authentication.

func New

func New(host string, tokens TokenSource) (*Client, error)

New constructs an authenticated Git client.

func (*Client) Run

func (c *Client) Run(ctx context.Context, dir string, args ...string) ([]byte, error)

Run executes Git in dir, or the current directory when dir is empty.

type TokenSource

type TokenSource interface {
	AccessToken(context.Context) (string, error)
}

TokenSource supplies the current repository access token.

type TokenSourceFunc

type TokenSourceFunc func(context.Context) (string, error)

TokenSourceFunc adapts a function to TokenSource.

func (TokenSourceFunc) AccessToken

func (f TokenSourceFunc) AccessToken(ctx context.Context) (string, error)

AccessToken returns the current token.

Jump to

Keyboard shortcuts

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