git

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package git provides repository cloning operations for JumpGate builds. Each build clones the target repository at a specific commit hash into an isolated temporary directory to avoid conflicts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloner

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

Cloner handles cloning git repositories at specific commits into isolated temporary directories.

func NewCloner

func NewCloner(baseDir string) *Cloner

NewCloner creates a Cloner that places clones under the given base directory (e.g., "/tmp/jumpgate-builds").

func (*Cloner) BaseDir

func (c *Cloner) BaseDir() string

BaseDir returns the base directory where clones are stored.

func (*Cloner) Cleanup

func (c *Cloner) Cleanup(clonePath string) error

Cleanup removes a clone directory and all its contents.

func (*Cloner) Clone

func (c *Cloner) Clone(ctx context.Context, repoURL, commitHash string) (string, error)

Clone performs a shallow clone of the repository at repoURL, checking out the exact commit hash. The clone is placed at {baseDir}/{commitHash}/. Returns the absolute path to the cloned repository.

Jump to

Keyboard shortcuts

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