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 ¶
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 ¶
GetCommitHash returns the current git commit hash for the given directory. Returns empty string if not a git repository or on error.
func IsBareRepo ¶
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.