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

vcstest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package vcstest builds the local git repository the replay tests of every backend share: a dependent branch whose parent was integrated upstream as a squash.

Index

Constants

View Source
const ChildAuthor = "Child Author <child@example.com>"

ChildAuthor is the author of the child branch's commits, which a replay keeps.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack struct {
	Dir string
	// OldBase is the parent's tip, where the child was started from; Head
	// the child's tip; Onto main's tip, the new upstream.
	OldBase, Head, Onto string
	// Parent and Child are the commits of each branch, oldest first.
	Parent, Child []string
	// ChildMessages are the child's commit messages, oldest first.
	ChildMessages []string
}

Stack is the repository: main, a parent branch of two commits started from it, a child branch of two commits started from the parent, and main again with the parent squashed onto it and one more commit.

func NewStack

func NewStack(t *testing.T, conflict bool) *Stack

NewStack builds the repository in a temporary directory, with the child branch checked out. With conflict, main's last commit changes a.txt and b.txt, which the child's first commit changes too, and c.txt, which its second commit changes.

func (*Stack) Git

func (s *Stack) Git(t *testing.T, args ...string) string

Git runs git in the stack's directory, with no configuration of the machine's, and returns its output.

func (*Stack) Read

func (s *Stack) Read(t *testing.T, name string) string

Read reads a file of the working tree.

func (*Stack) Write

func (s *Stack) Write(t *testing.T, name, content string)

Write writes a file of the working tree.

Jump to

Keyboard shortcuts

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