gitconfigenv

package
v1.229.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package gitconfigenv builds the git CLI's GIT_CONFIG_COUNT/GIT_CONFIG_KEY_n/ GIT_CONFIG_VALUE_n environment protocol (git 2.31+, see `git help config` "ENVIRONMENT") additively, instead of overwriting it.

That protocol is positional: whichever call site sets GIT_CONFIG_COUNT last wins outright, silently discarding any entries a different call site (or the parent process) already exported at slots 0..N. The Atmos CLI test harness has two independent producers of git config overrides -- a process-wide git mirror redirect (see tests/testhelpers/gitmirror) and a per-test credential.helper/extraheader override -- so a single hardcoded slot range is not safe. Append merges them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(target map[string]string, base []string, entries ...GitConfigEntry)

Append reads any GIT_CONFIG_COUNT/KEY_n/VALUE_n entries already present in base (typically os.Environ()), appends entries after them, and writes the resulting, consistently renumbered GIT_CONFIG_COUNT/KEY_n/VALUE_n set into target. Existing entries in base always come first, so an owner-scoped mirror redirect exported process-wide is never shadowed by a later, per-test override that also wants to add git config entries.

Types

type GitConfigEntry

type GitConfigEntry struct {
	Key   string
	Value string
}

GitConfigEntry is a single `git config` override, materialized as one GIT_CONFIG_KEY_n/GIT_CONFIG_VALUE_n pair.

Jump to

Keyboard shortcuts

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