local

package
v0.3.0-20261120180237-... Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package local implements gitworkspace.Workspace by executing commands as local subprocesses against a git clone on disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(p Params) (gitworkspace.Factory, error)

NewFactory creates a gitworkspace.Factory that runs commands as local subprocesses in the given directory. It fails when a set Runtime is invalid or only half of the committer identity is set.

Types

type Params

type Params struct {
	// Dir is the path to the local git clone.
	Dir string
	// Runtime pins the executable, helper paths and scrubbed environment that
	// git commands run on. When zero, git is resolved from PATH and inherits the
	// caller's environment.
	Runtime Runtime
	// CommitterName and CommitterEmail identify the committer of every commit a
	// git command creates. Set both or neither; when unset, the repository and
	// environment configuration decide.
	CommitterName  string
	CommitterEmail string
}

Params configures a local workspace factory.

type Runtime

type Runtime struct {
	// Executable is the absolute path to the Git executable.
	Executable string
	// ExecPath is the absolute directory containing Git's helper executables.
	ExecPath string
	// TemplateDir is the absolute directory containing Git's repository
	// templates.
	TemplateDir string
	// PassthroughEnv names additional environment variables to inherit from
	// the parent process, on top of the auth and transport ones always passed
	// through. For a deployment whose remote needs something unusual; leave
	// empty otherwise. Names that could alter merge semantics do not belong
	// here — the scrubbed environment is what keeps a merge reproducible.
	PassthroughEnv []string
}

Runtime identifies the explicitly provided Git runtime that commands run on.

func (Runtime) Command

func (r Runtime) Command(ctx context.Context, dir string, args ...string) *exec.Cmd

Command constructs a Git command without inheriting the caller's environment. The executable and helper paths come from the pinned runtime; repository-local configuration remains an intentional input.

func (Runtime) Validate

func (r Runtime) Validate() error

Validate reports whether every path of the runtime is set and absolute.

Jump to

Keyboard shortcuts

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