git

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package git resolves an HTTPS Git repository into a frozen snapshot.

Content is read from the commit's object tree, never from a working directory. That is the whole design: a checkout applies the user's global and repository configuration — core.autocrlf, clean and smudge filters, .gitattributes — any of which silently rewrites file bytes. A bundle built from a checkout would therefore depend on whose machine built it, which DP-012 forbids. Reading blobs directly means the bytes are the bytes the commit contains, everywhere, always.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// URL is the repository. HTTPS only in v1.
	URL string `json:"url"`
	// Ref is a branch, tag, or commit to resolve. Required when locking.
	Ref string `json:"ref"`
	// SubPath selects a directory within the repository.
	SubPath string `json:"subPath,omitempty"`
}

Config is a Git source's configuration.

type Resolver

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

Resolver resolves HTTPS Git repositories.

func New

func New() *Resolver

New returns a Git resolver that clones over HTTPS.

func (*Resolver) Identity

func (r *Resolver) Identity() source.Identity

Identity describes the resolver in provenance, so evidence records which implementation produced a resolution rather than only what it resolved to.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, req source.ResolveRequest) (_ source.Snapshot, retErr error)

Resolve fetches the repository and snapshots the resolved commit.

func (*Resolver) Type

func (r *Resolver) Type() string

Type is the manifest source type this resolver handles.

Jump to

Keyboard shortcuts

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