git

package
v0.6.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GitCommand = "git"

GitCommand is the path to the git binary, overridden in tests to check behavior when git is not installed.

Functions

func Archive

func Archive(ctx context.Context, gitRepoDir string, subdir string) (io.Reader, error)

Archive creates a tar archive of the files in the subdirectory given by subdir of the git repository at gitRepoDir. This is accomplished by running `git archive --format=tar HEAD:subdir` in the git repository directory.

The archive is written to the returned io.Reader. It is not necessary to close the returned reader. Any error encountered while starting the command will be returned immediately. Any error encountered after the command is running will be returned on the next read from the returned io.Reader.

func Clone

func Clone(ctx context.Context, gitRepo string, gitCommit string, targetDir string) error

func TarScrub

func TarScrub(in io.Reader, out io.Writer) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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