gitfixture

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gitfixture provides go-git-backed test fixtures (a fixed commit signature, a fresh repo, and a write+commit helper) for awf's test suites that need a real git repository. It is kept separate from internal/testsupport so a caller that only needs e.g. testsupport.WriteFile does not have to pull go-git into its test binary (ADR-0044).

Index

Constants

This section is empty.

Variables

View Source
var Sig = &object.Signature{Name: "T", Email: "t@example.com", When: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC)}

Sig is the fixed commit signature used by InitRepo/Commit fixtures across awf's test suites.

Functions

func Commit

func Commit(t *testing.T, repo *git.Repository, dir, msg string, write map[string]string, remove ...string) plumbing.Hash

Commit writes/removes the given paths in repo's worktree (rooted at dir), stages them, and commits with Sig, returning the commit hash.

func InitRepo

func InitRepo(t *testing.T) (*git.Repository, string)

InitRepo creates a fresh git repository in a new t.TempDir(), returning the repository and its root path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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