git

package
v0.1.0-dev.20260314201016 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	op.ProviderBase
	// contains filtered or unexported fields
}

Provider provides git actions.

+devlore:access=planned

func NewProvider

func NewProvider(ctx op.Context) *Provider

func (*Provider) Checkout

func (p *Provider) Checkout(repo Resource, ref string) (Resource, error)

Checkout checks out a ref in the given repository directory.

Parameters:

  • repo: git resource identifying the local repository
  • ref: Branch, tag, or commit to check out

func (*Provider) Clone

func (p *Provider) Clone(url netprov.Resource, destination file.Resource) (Resource, Tombstone, error)

Clone clones a repository from url into destination. Returns the cloned git.Resource and a Tombstone for compensation.

Parameters:

  • url: network resource identifying the git repository
  • destination: file resource identifying the local clone directory

func (*Provider) CompensateClone

func (p *Provider) CompensateClone(state Tombstone) error

CompensateClone removes the cloned directory.

func (*Provider) Pull

func (p *Provider) Pull(repo Resource) (Resource, error)

Pull pulls the latest changes in the given repository directory.

Parameters:

  • repo: git resource identifying the local repository

type Resource

type Resource struct {
	op.ResourceBase
	URL       string
	ClonePath string
	Ref       string
}

Resource represents a cloned git repository.

func ResourceFromValue

func ResourceFromValue(v any) (Resource, error)

ResourceFromValue constructs a git.Resource from a string clone path.

Parameters:

  • v: expected to be a string path

Returns:

  • Resource: initialized with the given clone path
  • error: if v is not a string

func (*Resource) Resolve

func (r *Resource) Resolve(_ op.Root) error

Resolve canonicalizes the clone path to an absolute path and updates the URI.

func (Resource) String

func (r Resource) String() string

String returns a compact JSON representation of the resource.

type Tombstone

type Tombstone struct {
	op.TombstoneBase
	ClonedPath string
}

Tombstone holds git-specific compensation state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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