gittest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gittest provides test utilities for the git package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryGitManager

type InMemoryGitManager struct {
	*git.GitManager
	// contains filtered or unexported fields
}

InMemoryGitManager wraps *git.GitManager with test-only accessors. The underlying repository uses in-memory storage (memfs).

func NewInMemoryGitManager

func NewInMemoryGitManager(t *testing.T, repoRoot string) *InMemoryGitManager

NewInMemoryGitManager creates a GitManager backed by in-memory storage. The repoRoot is a logical path (not a real filesystem path) used for path construction in tests.

The repository is seeded with an initial commit so HEAD exists.

func (*InMemoryGitManager) Repository

func (m *InMemoryGitManager) Repository() *gogit.Repository

Repository returns the underlying go-git Repository for test assertions.

Jump to

Keyboard shortcuts

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