push

package
v0.1.23-oss Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

TODO: Should submodules be supported? (submodule trees have 'commit' entries)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(rootCmd *root.RootCmd) *pushCmd

Types

type Crawler

type Crawler struct {
	RepoPath        string
	ParentRev       entities.Hash
	ExcludedObjects []entities.Hash
	Runner
}

Crawler will crawl a commit-ish revision tree and stream out objects in an order such that dependee blobs and trees appear before dependent commits. It makes the following assumptions:

  • Storage consumers are free of dangling commits. This affords us the ability to prune commits from the rev-list search without missing uncached objects.

func NewCrawler

func NewCrawler(repoPath string, parentRev entities.Hash, excludedObjects []entities.Hash) *Crawler

func (*Crawler) Objects

func (c *Crawler) Objects() (<-chan shellgit.ObjectTypeNameStreamItem, error)

Objects outputs object names in a safe topological order where all dependee objects occur before their dependent commits.

type Pusher

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

Pusher writes an object to storage.

func NewPusher

func NewPusher(repo *git.Repository, store entities.CASStore) *Pusher

func (*Pusher) Push

func (p *Pusher) Push(obj *shellgit.ObjectTypeName) (retErr error)

type Runner

type Runner interface {
	// ObjCount returns the number of objects reachable from rev but unreachable
	// from the exclude set.
	ObjCount(dir, rev string, excludes []entities.Hash) (int64, error)

	// RevListObjectsTopoOrder outputs objects reachable from rev but unreachable
	// from the exclude set. Commits are in topological order.
	RevListObjectsTopoOrder(dir, rev string, excludes []entities.Hash) (<-chan shellgit.ObjectTypeNameStreamItem, error)
}

Jump to

Keyboard shortcuts

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