builders

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package builders provides fluent test fixture builders for git operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloneOptionsBuilder

type CloneOptionsBuilder struct {
	// contains filtered or unexported fields
}

CloneOptionsBuilder builds clone operation options.

func NewCloneOptionsBuilder

func NewCloneOptionsBuilder() *CloneOptionsBuilder

NewCloneOptionsBuilder creates a new CloneOptionsBuilder.

func (*CloneOptionsBuilder) AsBare

AsBare sets bare clone mode.

func (*CloneOptionsBuilder) AsMirror

AsMirror sets mirror clone mode.

func (*CloneOptionsBuilder) Build

func (b *CloneOptionsBuilder) Build() map[string]any

Build returns the clone options as a map.

func (*CloneOptionsBuilder) BuildArgs

func (b *CloneOptionsBuilder) BuildArgs() []string

BuildArgs returns the git clone arguments.

func (*CloneOptionsBuilder) WithBranch

func (b *CloneOptionsBuilder) WithBranch(branch string) *CloneOptionsBuilder

WithBranch sets the branch to clone.

func (*CloneOptionsBuilder) WithDepth

func (b *CloneOptionsBuilder) WithDepth(depth int) *CloneOptionsBuilder

WithDepth sets the clone depth.

func (*CloneOptionsBuilder) WithPath

func (b *CloneOptionsBuilder) WithPath(path string) *CloneOptionsBuilder

WithPath sets the destination path.

func (*CloneOptionsBuilder) WithURL

WithURL sets the repository URL.

func (*CloneOptionsBuilder) WithoutProgress

func (b *CloneOptionsBuilder) WithoutProgress() *CloneOptionsBuilder

WithoutProgress disables progress output.

type GitRepoBuilder

type GitRepoBuilder struct {
	// contains filtered or unexported fields
}

GitRepoBuilder builds test git repositories with fluent interface.

func NewGitRepoBuilder

func NewGitRepoBuilder(t *testing.T) *GitRepoBuilder

NewGitRepoBuilder creates a new GitRepoBuilder.

func (*GitRepoBuilder) Build

func (b *GitRepoBuilder) Build() string

Build creates the git repository and returns its path.

func (*GitRepoBuilder) WithBranch

func (b *GitRepoBuilder) WithBranch(name string) *GitRepoBuilder

WithBranch adds a branch to be created.

func (*GitRepoBuilder) WithCommit

func (b *GitRepoBuilder) WithCommit(message string) *GitRepoBuilder

WithCommit adds a commit message (will create empty commit).

func (*GitRepoBuilder) WithFile

func (b *GitRepoBuilder) WithFile(name, content string) *GitRepoBuilder

WithFile adds a file to be created in the repository.

func (*GitRepoBuilder) WithRemote

func (b *GitRepoBuilder) WithRemote(name, url string) *GitRepoBuilder

WithRemote adds a remote to be configured.

func (*GitRepoBuilder) WithoutUserConfig

func (b *GitRepoBuilder) WithoutUserConfig() *GitRepoBuilder

WithoutUserConfig skips user configuration.

Jump to

Keyboard shortcuts

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