source

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package source provides repository content via the system git CLI (ADR-004): clone/fetch, archive materialization, and a one-pass "git log --name-status" scan that maps every file to its last-modified commit. The content set comes from the git tree, not the working directory, so builds are reproducible from repo + ref alone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Hash    string
	Time    time.Time
	Subject string
}

Commit is the last Git commit known to have modified a file.

type File

type File struct {
	Path       string // Repository-relative slash-separated path.
	Size       int64
	LastCommit *Commit
}

File is a regular repository file in the materialized tree.

type Spec

type Spec struct {
	Repo     string // URL or local path.
	Ref      string // Empty means HEAD.
	Worktree bool
}

Spec identifies the repository content source to materialize.

type Tree

type Tree struct {
	Root       string
	CommitHash string
	Files      []File
	// contains filtered or unexported fields
}

Tree is the materialized repository content set.

func Open

func Open(ctx context.Context, spec Spec) (*Tree, error)

Open materializes a deterministic repository content set. Callers must call Cleanup when the tree is no longer needed.

func (*Tree) Cleanup

func (t *Tree) Cleanup() error

Cleanup removes temporary materialized content owned by this Tree.

Jump to

Keyboard shortcuts

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