git

package
v0.0.0-...-ba0d244 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package git interacts with Git repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(wd string) vcs.VCS

Detect will return a vcs.VCS instance if the given working directory is a Git repository.

Types

type Git

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

Git is an instance of vcs.VCS that will operate on a Git repository.

func (*Git) Branch

func (g *Git) Branch() string

Branch returns the name of the checked out branch.

func (*Git) Commit

func (g *Git) Commit() string

Commit will return the commit id of the repository.

func (*Git) Config

func (g *Git) Config(key string) []string

Config will look up the given key and return a string slice of the values.

func (*Git) Name

func (g *Git) Name() string

Name returns git. This is used so that callers know what vcs they have.

func (*Git) Remote

func (g *Git) Remote(name string) string

Remote will return the url for the given remote or 'origin' if no remote is provided. If the repository does not have the given remote, empty string will be returned.

func (*Git) Root

func (g *Git) Root() string

Root will return the root of the repository.

func (*Git) ShortCommit

func (g *Git) ShortCommit() string

ShortCommit returns the short commit id of the repository.

Jump to

Keyboard shortcuts

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