Help us shape the future of Go! Take the 2026 Go Developer Survey

gitfixture

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gitfixture provides deterministic Git repository fixtures for tests.

Index

Constants

View Source
const (
	// UserName is the canonical author name for test commits.
	UserName = "Test User"
	// UserEmail is the canonical author email for test commits.
	UserEmail = "test@example.com"
)

Variables

This section is empty.

Functions

func ConfigureGoGitIdentity

func ConfigureGoGitIdentity(t testing.TB, repo *git.Repository)

ConfigureGoGitIdentity writes the canonical test author identity to repo's local config through go-git. Tests must not depend on a developer's global Git configuration, which may be absent in CI or intentionally hidden by a sandbox.

func ConfigureNativeIdentity

func ConfigureNativeIdentity(t testing.TB, repoDir string)

ConfigureNativeIdentity writes the same canonical identity through the Git CLI. Keeping native-git and go-git fixtures on one identity prevents tests from accidentally succeeding only because a developer has global Git credentials configured.

Types

This section is empty.

Jump to

Keyboard shortcuts

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