helpers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package helpers provides test utilities for creating git repositories and scenarios.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestRepo

type TestRepo struct {
	Path string
	// contains filtered or unexported fields
}

TestRepo represents a test git repository

func NewTestRepo

func NewTestRepo(t *testing.T, name string) *TestRepo

NewTestRepo creates a new test repository in a temporary directory

func (*TestRepo) AddFile

func (r *TestRepo) AddFile(filename string)

AddFile stages a file for commit

func (*TestRepo) AddRemote

func (r *TestRepo) AddRemote(name, url string)

AddRemote adds a remote to the repository

func (*TestRepo) Branches

func (r *TestRepo) Branches() []string

Branches returns a list of all branch names

func (*TestRepo) Checkout

func (r *TestRepo) Checkout(branch string)

Checkout switches to a branch

func (*TestRepo) Commit

func (r *TestRepo) Commit(message string)

Commit creates a commit with the current timestamp

func (*TestRepo) CommitWithDate

func (r *TestRepo) CommitWithDate(message string, date time.Time)

CommitWithDate creates a commit with a specific timestamp This is crucial for testing stale branch detection without waiting 30 days!

func (*TestRepo) CreateBranch

func (r *TestRepo) CreateBranch(name string)

CreateBranch creates a new branch

func (*TestRepo) CurrentBranch

func (r *TestRepo) CurrentBranch() string

CurrentBranch returns the current branch name

func (*TestRepo) Merge

func (r *TestRepo) Merge(branch string)

Merge merges a branch into the current branch

func (*TestRepo) Push

func (r *TestRepo) Push(remote, branch string)

Push pushes to a remote

func (*TestRepo) WriteFile

func (r *TestRepo) WriteFile(filename, content string)

WriteFile writes a file to the repository

Jump to

Keyboard shortcuts

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