git

package
v0.0.0-...-ba5b9b9 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

git manipulates on disk git repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Size int64
	io.ReadCloser
}

type Commit

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

Commit represents a commit object.

func (*Commit) String

func (c *Commit) String() string

func (*Commit) Tree

func (c *Commit) Tree() (*Tree, error)

Tree returns the Tree object for this commit.

type Entry

type Entry struct {
	*Tree // parent tree of this entry

	Name string
	Mode os.FileMode
	// contains filtered or unexported fields
}

type Repository

type Repository struct {

	// Root is the base path to the repository
	Root string
}

Repository represents a git repository.

func Open

func Open(p string) (*Repository, error)

Open returns a Repository representing the git repository that contains path. Open walks up the directory heirarchy until it finds a path with a .git, or it hits the root of the file system.

func (*Repository) Commit

func (r *Repository) Commit(sha string) (*Commit, error)

Commit returns a Commit matching the supplied id.

type Tree

type Tree struct {
	*Commit

	// entries are the
	Entries []Entry
	// contains filtered or unexported fields
}

Tree represents a tree object.

func (*Tree) Blob

func (t *Tree) Blob(name string) (*Blob, error)

Blob is a convenience method for returning a git blob object that is a child of the current tree.

func (*Tree) Tree

func (t *Tree) Tree(name string) (*Tree, error)

Tree is a convenience method for returning a git tree object that is a child of the current tree.

Jump to

Keyboard shortcuts

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