gitutil

package
v3.0.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gitutil implements an easy way to update a git repository to a local temporary directory.

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedClone = errors.New("failed to clone git repository")

ErrFailedClone is returned when a git clone is unsuccessful.

View Source
var ErrFailedPull = errors.New("failed to pull git repository")

ErrFailedPull is returned when a git pull is unsuccessful.

View Source
var ErrFailedRevParse = errors.New("failed to rev-parse git repository")

ErrFailedRevParse is returned when a git rev-parse is unsuccessful.

Functions

func CloneOrPull

func CloneOrPull(remote, repoPath, tempDirPrefix string) (path, head string, err error)

CloneOrPull performs a git pull if there is a git repository located at repoPath. Otherwise, it performs a git clone to that path.

If repoPath is left empty, a temporary directory is generated with the provided prefix and returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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