gitexec

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gitexec is the one place in the repo that shells out to `git`. Every caller used to carry its own copy of this ~15-line helper (changed, worktrees, doctor, gitclone, packagist, composer); this collapses them into one leaf package (stdlib only, so nothing can end up depending on it cyclically) that they all import instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(root string, args ...string) (string, error)

Run runs `git [-C root] args...` and returns raw, untrimmed stdout. root is omitted from the command line (no `-C`) when empty — load-bearing for gitclone's `clone`, which has no directory to `-C` into yet. On failure the returned error wraps git's own stderr, so callers surface git's actual complaint (auth, 404, not-a-repo) rather than a bare exit status.

func RunCtx

func RunCtx(ctx context.Context, root string, args ...string) (string, error)

RunCtx is Run with a caller-supplied context and GIT_TERMINAL_PROMPT=0, so a stale credential or unreachable remote fails fast instead of blocking on a prompt nothing will ever answer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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