Documentation
¶
Index ¶
Constants ¶
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 CommitExistsFunc ¶
type CommitExistsFunc func(r *git.Repository, hash plumbing.Hash) bool
CommitExistFunc checks if a commit exists in the repository
type DepthFetchFunc ¶
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 ¶
func (s *FullCloneStrategy) Type() capability.StrategyType
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 ¶
func (s *FullSHAStrategy) Type() capability.StrategyType
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 (s *IncrementalDeepenStrategy) Execute(ctx context.Context, r *git.Repository, req plumbing.Hash) error
func (*IncrementalDeepenStrategy) Type ¶
func (s *IncrementalDeepenStrategy) Type() capability.StrategyType
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 (s *ShallowSHAStrategy) Execute(ctx context.Context, r *git.Repository, req plumbing.Hash) error
func (*ShallowSHAStrategy) Type ¶
func (s *ShallowSHAStrategy) Type() capability.StrategyType