Documentation
¶
Index ¶
Constants ¶
View Source
const RemoteGitUrlRegex = "((git|ssh|http(s)?)|(git@[\\w\\.]+))(:(//)?)([\\w\\.@\\:/\\-~]+)(\\.git)(/)?"
Variables ¶
View Source
var InvalidReferenceErr = errors.New("invalid remote reference")
View Source
var (
RemoteGitUrlErr = errors.New("invalid git remote repository url")
)
Functions ¶
This section is empty.
Types ¶
type BranchName ¶
type BranchName string
type CloneOps ¶
type CloneOps struct {
Remote RemoteGitUrl
Path string
Refs BranchName
}
type Git ¶
type Git interface {
Clone(ops CloneOps) error
ListRemotes(repo Repo) ([]Remote, error)
Fetch(repo Repo) error
Status(repo Repo) (StatusRes, error)
CurrentBranch(repo Repo) (BranchName, error)
HasChanges(repo Repo) (bool, error)
DiffersFromRemote(repo Repo) (bool, error)
Switch(repo Repo, branch BranchName, force bool) error
Pull(repo Repo, rebase bool) error
PullBranch(repo Repo, branch BranchName, rebase bool) error
ListBranches(repo Repo) ([]BranchName, error)
CreateLightweightTag(repo Repo, tag string, branch BranchName) error
PushTag(repo Repo, tag Tag, remote Remote) error
}
type RemoteGitUrl ¶
type RemoteGitUrl string
func NewRemoteGitUrl ¶
func NewRemoteGitUrl(raw string) (RemoteGitUrl, error)
type Repo ¶
type Repo struct {
Remote RemoteGitUrl `yaml:"remote" json:"remote,omitempty"`
Path string `yaml:"rel_path" json:"rel_path,omitempty"`
Refs BranchName `yaml:"main_stream" json:"main_stream,omitempty"`
}
type StatusRes ¶
type StatusRes struct {
Change bool
Branch BranchName
}
Click to show internal directories.
Click to hide internal directories.