gitenv

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gitenv centralizes process environment sanitization for internal git commands that explicitly select their repository with -C or Cmd.Dir.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

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

Command constructs a git subprocess pinned to dir with inherited repository variables removed from the environment.

func IsRepositoryEnvName

func IsRepositoryEnvName(name string) bool

IsRepositoryEnvName reports whether name points Git at an inherited repository, index, object store, or namespace that can override an explicit worktree path.

func Run

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

Run executes a sanitized git subprocess and returns trimmed stdout.

func SanitizedEnv

func SanitizedEnv() []string

SanitizedEnv returns the current process environment without repository-local Git variables. Transport and credential variables such as GIT_SSH_COMMAND are intentionally preserved.

Types

This section is empty.

Jump to

Keyboard shortcuts

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