gitstar

package module
v0.0.0-...-ae4d12d Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checkout

func Checkout(ctx context.Context, opts Options) error

Checkout materializes the regular files in opts.Treeish from opts.Remote into opts.Dir.

Treeish may be a ref or ref:path. Only regular files from that tree are written. Symlinks, gitlinks, and unusual file modes are rejected.

Types

type Entry

type Entry struct {
	Path string
	Hash Hash
	Mode fs.FileMode
}

Entry is a regular file in a Git tree.

type Hash

type Hash [20]byte

Hash is a SHA-1 hash identifying a particular Git object.

func (Hash) String

func (h Hash) String() string

type Options

type Options struct {
	Remote      string
	Treeish     string
	Dir         string
	BatchSize   int
	Parallelism int
	HTTPClient  *http.Client
}

Options controls a checkout.

type Repo

type Repo struct {
	// URL is the remote Git HTTP(S) URL.
	URL string

	// Client is the HTTP client used to talk to URL.
	// If Client is nil, http.DefaultClient is used.
	Client *http.Client
	// contains filtered or unexported fields
}

Repo is a connection to a remote repository served over HTTP or HTTPS.

func (*Repo) Resolve

func (r *Repo) Resolve(ctx context.Context, ref string) (Hash, error)

Resolve looks up ref and returns the corresponding hash.

Directories

Path Synopsis
cmd
git-star command
internal
httprr
Package httprr implements HTTP record and replay, mainly for use in tests.
Package httprr implements HTTP record and replay, mainly for use in tests.

Jump to

Keyboard shortcuts

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