git

package
v0.1.0-dev.20260306003143 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 7 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=both

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 (*Resource) Host

func (r *Resource) Host() string

Host returns empty string — git URIs use path-only identification.

func (*Resource) Path

func (r *Resource) Path() string

Path returns the canonicalized absolute clone path.

func (*Resource) Scheme

func (r *Resource) Scheme() string

Scheme returns "git".

func (*Resource) URI

func (r *Resource) URI() string

URI returns the canonical git:// URI for this 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