git

package
v0.0.0-...-13edf49 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const HEAD = "HEAD"

Variables

This section is empty.

Functions

This section is empty.

Types

type CloneOptions

type CloneOptions struct {
	SparseFilter []string
}

/ CloneOptions to tune the behavior of git clone.

type Options

type Options struct {
	IsFSBacked        bool
	Dir               string
	ResolveExactTag   bool
	RecurseSubModules bool // TODO
	AllowPreReleases  bool
	Debug             bool
	GitSkipAutoDetect bool
}

Options for a git Repository

type Ref

type Ref struct {
	*plumbing.Reference

	ShortName string
	IsTag     bool
	IsSemver  bool
	Version   semver.Version
}

Ref wraps a git plumbing.Reference.

type Repository

type Repository struct {
	*Options
	// contains filtered or unexported fields
}

Repository is a git repo.

func NewRepo

func NewRepo(repoURL *url.URL, opts *Options) *Repository

NewRepo initializes a new git repository for a given URL.

No resources are actually fetched or stored yet.

func (*Repository) Clone

func (r *Repository) Clone(ctx context.Context, ref string, opts *CloneOptions) (fs.FS, error)

Clone the repository defined by an URL.

func (*Repository) Fetch

func (r *Repository) Fetch(ctx context.Context, w io.Writer, file, ref string) error

Fetch a file at a given ref from the Repository.

The file is copied to the given io.Writer.

Jump to

Keyboard shortcuts

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