Documentation
¶
Index ¶
- Variables
- type ExecGit
- func (g *ExecGit) AddAll(dir string) error
- func (g *ExecGit) Checkout(dir, branch string, create bool) error
- func (g *ExecGit) Clone(tokenURL, dir, branch string, depth int) error
- func (g *ExecGit) Commit(dir, message, authorName, authorEmail string) error
- func (g *ExecGit) Fetch(dir, tokenURL, branch string) error
- func (g *ExecGit) IsClean(dir string) (bool, error)
- func (g *ExecGit) Pull(dir, tokenURL, branch string) error
- func (g *ExecGit) Push(dir, tokenURL, branch string) error
- type Git
- type GitError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ExecGit ¶
type ExecGit struct {
// contains filtered or unexported fields
}
ExecGit runs git commands via the system git binary.
func (*ExecGit) Checkout ¶
Checkout switches to branch. When create=true it tries -b first, then falls back to a plain checkout if the branch already exists.
func (*ExecGit) Commit ¶
Commit creates a commit with the given message and author/committer identity. -c user.name/email sets the committer; --author sets the author explicitly.
func (*ExecGit) Fetch ¶
Fetch fetches branch from the given URL. ErrRemoteRefNotFound, ErrAlreadyUpToDate, "refusing to fetch into current branch", and "shallow update not allowed" are swallowed.
type Git ¶
type Git interface {
Clone(tokenURL, dir, branch string, depth int) error
Checkout(dir, branch string, create bool) error
Fetch(dir, tokenURL, branch string) error
Pull(dir, tokenURL, branch string) error
Push(dir, tokenURL, branch string) error
IsClean(dir string) (bool, error)
AddAll(dir string) error
Commit(dir, message, authorName, authorEmail string) error
}
Click to show internal directories.
Click to hide internal directories.