git

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package git provides functionality to resolve Git repository commit checksums

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct{}

Client handles git operations

func NewClient

func NewClient() *Client

NewClient creates a new git client

func (*Client) GetCommitChecksum

func (c *Client) GetCommitChecksum(ctx context.Context, rawURL string) (string, error)

GetCommitChecksum resolves a git reference to its commit SHA Uses git ls-remote to fetch the commit without cloning the repository Delegates to BuildKit's gitutil for authentication, SSH, and proxy support

type GitRef

type GitRef struct {
	// Remote is the git remote URL (without fragment)
	Remote string
	// Ref is the git reference (branch, tag, or commit)
	Ref string
	// Subdir is the optional subdirectory path
	Subdir string
}

GitRef represents a parsed git reference

func ParseGitURL

func ParseGitURL(rawURL string) (*GitRef, error)

ParseGitURL parses a git URL that may contain a fragment with ref and subdir Format: <url>#<ref>[:<subdir>] Examples:

Jump to

Keyboard shortcuts

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