git

package
v0.15.1-0...-e5b4670 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package git contains all the Git operations that can be applied to asdf Git repositories like the plugin index repo and individual asdf plugins.

Index

Constants

View Source
const DefaultRemoteName = "origin"

DefaultRemoteName for Git repositories in asdf

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	Directory string
	URL       string
}

Repo is a struct to contain the Git repository details

func NewRepo

func NewRepo(directory string) Repo

NewRepo builds a new Repo instance

func (Repo) Clone

func (r Repo) Clone(pluginURL, ref string) error

Clone installs a plugin via Git

func (Repo) Head

func (r Repo) Head() (string, error)

Head returns the current HEAD ref of the plugin's Git repository

func (Repo) RemoteURL

func (r Repo) RemoteURL() (string, error)

RemoteURL returns the URL of the default remote for the plugin's Git repository

func (Repo) Update

func (r Repo) Update(ref string) (string, string, string, error)

Update updates the plugin's Git repository to the ref if provided, or the latest commit on the current branch

type Repoer

type Repoer interface {
	Clone(pluginURL, ref string) error
	Head() (string, error)
	RemoteURL() (string, error)
	Update(ref string) (string, string, string, error)
}

Repoer is an interface for operations that can be applied to asdf plugins. Right now we only support Git, but in the future we might have other mechanisms to install and upgrade plugins. asdf doesn't require a plugin to be a Git repository when asdf uses it, but Git is the only way to install and upgrade plugins. If other approaches are supported this will be extracted into the `plugins` module.

Jump to

Keyboard shortcuts

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