gitutil

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepo

func CloneRepo(gitURL string, opts CloneOptions) (string, error)

CloneRepo clones a git URL into the configured storage directory. Returns the absolute path to the cloned directory.

func GitURLToDirName

func GitURLToDirName(rawURL string) (string, error)

GitURLToDirName derives a filesystem-safe directory name from a git URL. e.g. "https://github.com/juice-shop/juice-shop" -> "github.com_juice-shop_juice-shop"

func LooksLikeGitURL

func LooksLikeGitURL(s string) bool

LooksLikeGitURL returns true if the value looks like a git URL rather than a local path.

Types

type CloneOptions

type CloneOptions struct {
	StoragePath string // base directory for cloned repos
	CloneDepth  int    // git clone --depth value (default: 1)
	Branch      string // branch to clone (empty = default branch)
	AuthToken   string // if set, injected into HTTPS clone URLs for private repo access
}

CloneOptions configures a git clone operation.

Jump to

Keyboard shortcuts

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