Documentation
¶
Overview ¶
Package clone provides git repository cloning utilities for the build system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct {
// GitURL is the URL that was being cloned
GitURL string
// GitRef is the ref that was being checked out
GitRef string
// Stderr contains the git stderr output
Stderr string
// ExitCode is the exit code from git
ExitCode int
// Err is the underlying error
Err error
}
Error represents a detailed error from a git clone operation.
type Result ¶
type Result struct {
// RepoPath is the path to the cloned repository
RepoPath string
// CommitSHA is the resolved commit SHA after checkout
CommitSHA string
}
Result contains the result of a successful clone operation.
func Repository ¶
Repository clones a git repository to the specified destination path. It uses shallow clone (--depth 1) for efficiency as specified in Requirements 4.1.
Parameters:
- ctx: Context for cancellation
- gitURL: The git repository URL to clone
- gitRef: The git ref to checkout (branch, tag, or commit). If empty, uses default branch.
- destPath: The destination path for the cloned repository
Returns:
- *Result: Contains the repo path and resolved commit SHA
- error: A *Error with detailed information on failure
**Validates: Requirements 1.1, 4.1**
Click to show internal directories.
Click to hide internal directories.