gittest

package
v1.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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