gitexec

package
v0.3.0-20260819153324-... Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gitexec locates a git binary and runs it with the ambient environment stripped out.

Demo and development tooling drives git on a developer's own machine, where hooks, a signing key, or a commit template configured globally would each break a run in a way that has nothing to do with SubmitQueue. Every command built here therefore carries the same scrubbed environment the git merger uses (see runway/extension/merger/git), so tooling behaves the same on every machine.

This resolves only the executable, because tooling runs porcelain (init, clone, commit, push) rather than constructing a merger's GitRuntime, which additionally pins the exec path and template directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

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

Command builds a git invocation in dir with the ambient environment removed. An empty dir runs in the current working directory.

func Output

func Output(ctx context.Context, git, dir string, args ...string) (string, error)

Output executes a git command and returns its trimmed stdout.

func Resolve

func Resolve(path string) (string, error)

Resolve returns an absolute path to a git binary.

Preference order is the supplied path, then GIT_EXECUTABLE, then PATH — the same convention the Runway server's runtime resolution follows, so a deployment or a Bazel target can pin git without the caller knowing which did.

func Run

func Run(ctx context.Context, git, dir string, args ...string) error

Run executes a git command and discards its output, reporting stderr in the error so a failure says what git said rather than only that it exited.

Types

This section is empty.

Jump to

Keyboard shortcuts

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