git

package
v0.0.0-...-6a85243 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package git shells out to gather information about the current repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Deleted  []string
	Modified []string
}

A Diff enumerates the files changed between two points in history.

type Repository

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

A Repository offers access to a handful of useful git commands.

func New

func New(logger *hhlog.Logger) (*Repository, error)

New initializes and returns a Repository.

func (*Repository) All

func (r *Repository) All() (Diff, error)

All returns all files in the repository, including untracked files, relative to the repository root.

func (*Repository) Canonicalize

func (r *Repository) Canonicalize(commitish string) (string, error)

Canonicalize converts the supplied commitish to a SHA1.

func (*Repository) Diff

func (r *Repository) Diff(since string) (Diff, error)

Diff returns the paths of files changed since the supplied commitish, relative to the repository root.

func (*Repository) Root

func (r *Repository) Root() string

Root returns the absolute path to the repository root.

Jump to

Keyboard shortcuts

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