gittest

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepo

func NewRepo(t *testing.T, fs billy.Filesystem, commits ...CommitFunc) *git.Repository

NewRepo returns a new Git repository.

func NewServer

func NewServer(fs billy.Filesystem) http.Handler

NewServer returns a http.Handler that serves a git repository. It's expected that the repository is already initialized by the caller.

func NewServerSSH

func NewServerSSH(t *testing.T, fs billy.Filesystem, pubkeys ...gossh.PublicKey) *transport.Endpoint

func WriteFile

func WriteFile(t *testing.T, fs billy.Filesystem, path, content string)

WriteFile writes a file to the filesystem.

Types

type CommitFunc

type CommitFunc func(billy.Filesystem, *git.Repository)

CommitFunc commits to a repo.

func Commit

func Commit(t *testing.T, path, content, msg string) CommitFunc

Commit is a test helper for committing a single file to a repo.

Jump to

Keyboard shortcuts

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