git

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package git provides git repository management functionality for quad-ops

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	Name       string // repository identifier
	URL        string // remote git URL
	Reference  string // git ref: branch, tag, or commit hash
	ComposeDir string // optional subdirectory in repo containing compose files
	Path       string // local path where repository will be cloned/synced
	// contains filtered or unexported fields
}

Repository represents a Git repository to sync to a local path.

func New added in v0.30.0

func New(name, url, ref, composeDir, path string) *Repository

New creates a new Repository instance.

func (*Repository) CheckoutRef added in v0.30.0

func (r *Repository) CheckoutRef(ref string) error

CheckoutRef opens an existing repository and checks out the given reference without fetching from the remote. Used for rollback to a known commit.

func (*Repository) GetCurrentCommitHash added in v0.24.1

func (r *Repository) GetCurrentCommitHash() (string, error)

GetCurrentCommitHash returns the current HEAD commit hash.

func (*Repository) Sync added in v0.30.0

func (r *Repository) Sync(ctx context.Context) error

Sync clones the remote repository to the local path if it doesn't exist, or opens the existing repository and pulls the latest changes if it does. It returns an error if any Git operations fail. Context can be used to signal cancellation.

Jump to

Keyboard shortcuts

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