updateref

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

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

Updater wraps a `git update-ref --stdin` process, presenting an interface that allows references to be easily updated in bulk. It is not suitable for concurrent use.

func New

func New(ctx context.Context, repo repository.GitRepo) (*Updater, error)

New returns a new bulk updater, wrapping a `git update-ref` process. Call the various methods to enqueue updates, then call Wait() to attempt to apply all the updates at once.

It is important that ctx gets canceled somewhere. If it doesn't, the process spawned by New() may never terminate.

func (*Updater) Create

func (u *Updater) Create(ref, value string) error

Create commands the reference to be created with the sha specified in value

func (*Updater) Delete

func (u *Updater) Delete(ref string) error

Delete commands the reference to be removed from the repository

func (*Updater) Update

func (u *Updater) Update(ref, newvalue string) error

Update commands the reference to be updated to point at the sha specified in newvalue

func (*Updater) Wait

func (u *Updater) Wait() error

Wait applies the commands specified in other calls to the Updater

Jump to

Keyboard shortcuts

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