strategy

package
v0.15.0-alpha.8 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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxDeepenIterations is the maximum number of deepen attempts before giving up
	MaxDeepenIterations = 100
)

Variables

This section is empty.

Functions

func Checkout

func Checkout(r *git.Repository, opts *CheckoutOptions) error

Checkout performs a git checkout to the specified hash.

Types

type CheckoutFunc

type CheckoutFunc func(r *git.Repository, hash *plumbing.Hash) error

CheckoutFunc performs a git checkout operation

type CheckoutOptions

type CheckoutOptions struct {
	Hash plumbing.Hash
}

type CommitExistsFunc

type CommitExistsFunc func(r *git.Repository, hash plumbing.Hash) bool

CommitExistFunc checks if a commit exists in the repository

type DepthFetchFunc

type DepthFetchFunc func(ctx context.Context, r *git.Repository, depth int) error

DepthFetchFunc performs a git fetch at a specific depth

type FetchFunc

type FetchFunc func(ctx context.Context, r *git.Repository) error

FetchFunc performs a git fetch operation

type FullCloneStrategy

type FullCloneStrategy struct {
	// contains filtered or unexported fields
}

FullCloneStrategy fetches the entire repository (all branches and tags). This is the fallback strategy when no optimizations are available.

func NewFullCloneStrategy

func NewFullCloneStrategy(auth transport.AuthMethod) *FullCloneStrategy

func (*FullCloneStrategy) Execute

func (s *FullCloneStrategy) Execute(ctx context.Context, r *git.Repository, req plumbing.Hash) error

func (*FullCloneStrategy) Type

type FullSHAStrategy

type FullSHAStrategy struct {
	// contains filtered or unexported fields
}

FullSHAStrategy fetches a specific commit with full history (no depth limit). This is used when the server supports allow-reachable-sha1-in-want but not shallow.

func NewFullSHAStrategy

func NewFullSHAStrategy(auth transport.AuthMethod) *FullSHAStrategy

func (*FullSHAStrategy) Execute

func (s *FullSHAStrategy) Execute(ctx context.Context, r *git.Repository, req plumbing.Hash) error

func (*FullSHAStrategy) Type

type IncrementalDeepenStrategy

type IncrementalDeepenStrategy struct {
	// contains filtered or unexported fields
}

IncrementalDeepenStrategy fetches using shallow clone then deepens incrementally until the target commit is reachable. This is used when the server supports shallow but not allow-reachable-sha1-in-want.

func NewIncrementalStrategy

func NewIncrementalStrategy(auth transport.AuthMethod) *IncrementalDeepenStrategy

func (*IncrementalDeepenStrategy) Execute

func (*IncrementalDeepenStrategy) Type

type ShallowSHAStrategy

type ShallowSHAStrategy struct {
	// contains filtered or unexported fields
}

ShallowSHAStrategy fetches a specific commit with depth=1 (shallow clone). This is the most efficient strategy when the server supports both allow-reachable-sha1-in-want and shallow.

func NewShallowSHAStrategy

func NewShallowSHAStrategy(auth transport.AuthMethod) *ShallowSHAStrategy

func (*ShallowSHAStrategy) Execute

func (*ShallowSHAStrategy) Type

Jump to

Keyboard shortcuts

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