gogit

package module
v0.0.0-...-a5a1e1c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

README

GoGit

A simple Go wrapper around the git command line tool.

For actual Go git client libraries see https://github.com/src-d/go-git or https://github.com/libgit2/git2go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffStat

type DiffStat struct {
	Stat     ModType
	Filename string
}

type GitOpts

type GitOpts struct {
	Rebase   bool
	CloneDir string
}

type ModType

type ModType int
const (
	StatNew ModType = iota
	StatModified
	StatDeleted
)

type Repo

type Repo struct {
	URL     string
	Name    string
	WorkDir string
	RepoDir string
	// contains filtered or unexported fields
}

func New

func New(url, branch, workDir string, logger log.Logger, options ...SetOptFunc) (*Repo, error)

func (*Repo) Add

func (r *Repo) Add(pattern string) error

func (*Repo) AddCommitPush

func (r *Repo) AddCommitPush(msg string) error

func (*Repo) Branch

func (r *Repo) Branch() (string, error)

func (*Repo) Checkout

func (r *Repo) Checkout(b string) error

func (*Repo) Clone

func (r *Repo) Clone() error

func (*Repo) CloneOrPull

func (r *Repo) CloneOrPull() error

func (*Repo) Commit

func (r *Repo) Commit(msg string) error

func (*Repo) CommitAuthor

func (r *Repo) CommitAuthor(commit string) (string, error)

func (*Repo) CurrentCommit

func (r *Repo) CurrentCommit() (string, error)

func (*Repo) DiffStatus

func (r *Repo) DiffStatus(c1, c2 string) ([]*DiffStat, error)

func (*Repo) IsClean

func (r *Repo) IsClean() bool

func (*Repo) Pull

func (r *Repo) Pull(options ...SetOptFunc) error

func (*Repo) Push

func (r *Repo) Push() error

func (*Repo) ShowDeletedFile

func (r *Repo) ShowDeletedFile(path string) (string, error)

ShowDeletedFile fetches the last version of a file, from just before it got deleted from the current repo and branch

func (*Repo) ShowForCommit

func (r *Repo) ShowForCommit(commit, path string) (string, error)

type SetOptFunc

type SetOptFunc func(o *GitOpts)

func SetCloneDir

func SetCloneDir(s string) SetOptFunc

func SetOptRebase

func SetOptRebase() SetOptFunc

Jump to

Keyboard shortcuts

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