git

package
v0.0.0-...-5dc5273 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRemote = errors.New("No remote found")
View Source
var ErrNotAGitRepository = errors.New("Not a git repository")

Functions

This section is empty.

Types

type GitRepoStub

type GitRepoStub struct {
	RemoteURI         string
	CurrentCommitHash string
	Submodules        map[string]*GitRepoStub
}

func NewGitRepoStub

func NewGitRepoStub() *GitRepoStub

type GitService

type GitService interface {
	Clone(targetPath, remoteURI string) error
	AddSubmodule(repoDir, remoteURI, targetPath string) error
	RemoveSubmodule(repoDir, targetPath string) error
	CheckoutCommit(repoDir, commitHash string) error
	GetRemoteURI(repoDir string) (string, error)
	GetCurrentCommitHash(repoDir string) (string, error)
	GetRootDir(dir string) (string, error)
	InitRepo(repoDir string) error
	InitSubmodules(repoDir string) error
	UpdateSubmodules(repoDir string) error
}
var Service GitService = NewGitService()

func NewGitService

func NewGitService() GitService

type GitStub

type GitStub struct {
	Repos map[string]*GitRepoStub
}

func NewGitStub

func NewGitStub() *GitStub

func (*GitStub) AddSubmodule

func (self *GitStub) AddSubmodule(repoDir, remoteURI, targetPath string) error

func (*GitStub) CheckoutCommit

func (self *GitStub) CheckoutCommit(repoDir, commitHash string) error

func (*GitStub) Clone

func (self *GitStub) Clone(targetPath, remoteURI string) error

func (*GitStub) GetCurrentCommitHash

func (self *GitStub) GetCurrentCommitHash(repoDir string) (string, error)

func (*GitStub) GetRemoteURI

func (self *GitStub) GetRemoteURI(repoDir string) (string, error)

func (*GitStub) GetRootDir

func (self *GitStub) GetRootDir(dir string) (string, error)

func (*GitStub) InitRepo

func (self *GitStub) InitRepo(repoDir string) error

func (*GitStub) InitSubmodules

func (self *GitStub) InitSubmodules(repoDir string) error

func (*GitStub) RemoveSubmodule

func (self *GitStub) RemoveSubmodule(repoDir, targetPath string) error

func (*GitStub) UpdateSubmodules

func (self *GitStub) UpdateSubmodules(repoDir string) error

Jump to

Keyboard shortcuts

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