Documentation ¶
Index ¶
- Constants
- Variables
- type Branch
- type CheckoutResult
- type CloneResult
- type Commit
- type CommitUser
- type CreateResult
- type GitService
- func (g *GitService) Checkout(repo *model.Repo, ref string) (CheckoutResult, error)
- func (g *GitService) CleanBranches(repo *model.Repo, mode config.GitMode) (string, error)
- func (g *GitService) CloneRepo(repo *model.Repo, recreate bool) (CloneResult, error)
- func (g *GitService) Commit(repo *model.Repo, pattern string, message string) error
- func (g *GitService) CreateBranch(repo *model.Repo, name string) (CreateResult, error)
- func (g *GitService) Discard(repo *model.Repo) error
- func (g *GitService) Fetch(repo *model.Repo) error
- func (g *GitService) GetBranches(repo *model.Repo, mode config.GitMode, pattern string) ([]Branch, error)
- func (g *GitService) GetDefaultBranch(repo *model.Repo) (*Branch, error)
- func (g *GitService) GetUnmergedBranches(repo *model.Repo, mode config.GitMode, ref string) ([]Branch, error)
- func (g *GitService) GetUnmergedCommits(repo *model.Repo, branch Branch, ref string) ([]Commit, error)
- func (g *GitService) Pull(repo *model.Repo) error
- func (g *GitService) Push(repo *model.Repo, branch string, allBranches bool, force bool) error
- func (g *GitService) RemoveBranch(repo *model.Repo, branch Branch) error
- func (g *GitService) Status(repo *model.Repo) (StatusResult, string, error)
- type StatusResult
Constants ¶
View Source
const ( RefPrefix = "refs/" RefHeadPrefix = RefPrefix + "heads/" RefRemotePrefix = RefPrefix + "remotes/" Head = "HEAD" )
Variables ¶
View Source
var (
ErrDetachedHead = errors.New("detached head")
)
Functions ¶
This section is empty.
Types ¶
type Branch ¶ added in v0.6.0
func (*Branch) GetGitMode ¶ added in v0.6.0
type CheckoutResult ¶ added in v0.6.0
type CheckoutResult string
const ( CheckoutOk CheckoutResult = "success" CheckoutNotFound CheckoutResult = "not found" CheckoutError CheckoutResult = "error" )
func (*CheckoutResult) String ¶ added in v0.6.0
func (r *CheckoutResult) String() string
type CloneResult ¶
type CloneResult string
const ( ClonedSuccessfully CloneResult = "cloned" ClonedAlready CloneResult = "already cloned" ClonedAgain CloneResult = "re-cloned" CloneError CloneResult = "error" )
func (*CloneResult) String ¶ added in v0.6.0
func (r *CloneResult) String() string
type Commit ¶ added in v0.8.0
type Commit struct { Id string AuthorDate time.Time Author CommitUser CommitDate time.Time Committer CommitUser }
type CommitUser ¶ added in v0.12.0
func (*CommitUser) String ¶ added in v0.12.0
func (u *CommitUser) String() string
type CreateResult ¶ added in v0.6.0
type CreateResult string
const ( CreateOk CreateResult = "created" CreateError CreateResult = "error" )
func (*CreateResult) String ¶ added in v0.6.0
func (r *CreateResult) String() string
type GitService ¶ added in v0.10.0
type GitService struct {
// contains filtered or unexported fields
}
func NewGitService ¶ added in v0.10.0
func NewGitService(sh shell.Shell) GitService
func (*GitService) Checkout ¶ added in v0.10.0
func (g *GitService) Checkout(repo *model.Repo, ref string) (CheckoutResult, error)
func (*GitService) CleanBranches ¶ added in v0.10.0
func (*GitService) CloneRepo ¶ added in v0.10.0
func (g *GitService) CloneRepo(repo *model.Repo, recreate bool) (CloneResult, error)
func (*GitService) CreateBranch ¶ added in v0.10.0
func (g *GitService) CreateBranch(repo *model.Repo, name string) (CreateResult, error)
func (*GitService) GetBranches ¶ added in v0.10.0
func (*GitService) GetDefaultBranch ¶ added in v0.12.0
func (g *GitService) GetDefaultBranch(repo *model.Repo) (*Branch, error)
func (*GitService) GetUnmergedBranches ¶ added in v0.12.0
func (g *GitService) GetUnmergedBranches(repo *model.Repo, mode config.GitMode, ref string) ([]Branch, error)
GetUnmergedBranches returns branches that are not merged to `ref`
func (*GitService) GetUnmergedCommits ¶ added in v0.12.0
func (g *GitService) GetUnmergedCommits(repo *model.Repo, branch Branch, ref string) ([]Commit, error)
GetUnmergedCommits returns commits from branch `branch` that are not merged to ref `ref`. The commits are ordered by `committedAt` attribute Returns an error when `branch` and `ref` don't have a common parent
func (*GitService) RemoveBranch ¶ added in v0.10.0
func (g *GitService) RemoveBranch(repo *model.Repo, branch Branch) error
func (*GitService) Status ¶ added in v0.10.0
func (g *GitService) Status(repo *model.Repo) (StatusResult, string, error)
type StatusResult ¶ added in v0.4.0
type StatusResult string
const ( StatusClean StatusResult = "clean" StatusDirty StatusResult = "dirty" StatusMissing StatusResult = "missing" StatusError StatusResult = "error" )
func (*StatusResult) String ¶ added in v0.6.0
func (r *StatusResult) String() string
Click to show internal directories.
Click to hide internal directories.