gitclone

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Overview

Package gitclone provides pinned local checkouts backed by git-pkgs/clone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultContextCacheDir

func DefaultContextCacheDir(workDir, repoID string) string

DefaultContextCacheDir returns a sibling cache directory for a work tree.

Types

type Client

type Client struct {
	Cred auth.Credential
	// contains filtered or unexported fields
}

Client materializes exact commit SHAs into local directories.

func (*Client) EnsureCheckout

func (c *Client) EnsureCheckout(ctx context.Context, remoteURL, dst, targetSHA string) error

EnsureCheckout clones or updates dst to targetSHA (full commit or prefix).

func (*Client) Head

func (c *Client) Head(ctx context.Context, dst string) (string, error)

Head returns the current commit at dst.

func (*Client) ResolveBranchHead

func (c *Client) ResolveBranchHead(ctx context.Context, remoteURL, branch string) (string, error)

ResolveBranchHead resolves a remote branch to an immutable commit SHA.

type HeadDriftError

type HeadDriftError struct {
	Expected    string
	Observed    string
	Destination string
}

HeadDriftError reports checkout verification failure.

func (*HeadDriftError) Error

func (e *HeadDriftError) Error() string

Jump to

Keyboard shortcuts

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