git

package
v2.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package git provides Git repository operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(dloadFilePath, sourceItemURI, sshPassword string,
	referenceName plumbing.ReferenceName, commitHash string,
) error

Clone clones a Git repository from the given sourceItemURI to the specified dloadFilePath.

Parameters: - sourceItemURI: the URI of the Git repository to clone. - dloadFilePath: the file path to clone the repository into. - sshPassword: the password for SSH authentication (optional). - referenceName: the reference name for the clone operation. - commitHash: if non-empty, checkout this specific commit after cloning.

func ExtractFromBare

func ExtractFromBare(barePath, srcDir, refKey, refValue string) error

ExtractFromBare creates a working copy from a bare/mirror git repository, then checks out the requested reference. This mirrors makepkg's extract_git() behavior: open the bare cache, init a new repo in srcdir, fetch objects, and checkout the requested ref (no git CLI required).

func GetCommitHash

func GetCommitHash(repoPath string) string

GetCommitHash returns the current git commit hash for the given directory. Returns empty string if not a git repository or on error.

func IsBareRepo

func IsBareRepo(path string) bool

IsBareRepo checks if the given path is a bare git repository (contains HEAD file at the top level with no .git subdirectory).

Types

This section is empty.

Jump to

Keyboard shortcuts

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