Documentation
¶
Index ¶
- func Add(files []string) int
- func BranchExist(remote string) (bool, error)
- func Branches() ([]string, error)
- func Commit(msg string, errorIfEmpty bool) (err error)
- func Do(opts ...string) int
- func EnsureRemoteIs(name, url string) error
- func EnsureRepoExist(aPath string) error
- func Get(opts ...string) (string, error)
- func GetCurrentBranch() (branch string)
- func GetWithStatusCode(opts ...string) (string, int)
- func Indent(begin, indent, end string)
- func Push() error
- func RemoteBranchExist(remote string) (bool, error)
- func RemoteBranches() ([]string, error)
- func RemoteExist(remote string) (found bool)
- func RemoteStatus(remote string) (_ string, err error)
- func RemoteURL(remote string) (string, bool, error)
- func RunInPath(gitRepoPath string, runIn func() error) error
- func SetLogFunc(aLogFunc func(string))
- func ShowGitPath() (msg string)
- func UnIndent()
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchExist ¶
BranchExist return true if the branch exist
func EnsureRemoteIs ¶
EnsureRemoteIs will update the remote name with the url...
func EnsureRepoExist ¶
EnsureRepoExist ensure a local repo exist.
func GetCurrentBranch ¶
func GetCurrentBranch() (branch string)
GetCurrentBranch return the current branch name. If no branch is detected, it returns "master"
func GetWithStatusCode ¶
GetWithStatusCode Call a git command and get the output as string output.
func Indent ¶
func Indent(begin, indent, end string)
Indent permit to display several command indented within a section tag.
func RemoteBranchExist ¶
RemoteBranchExist check is remote branch if known by GIT.
Remote: Formated as <remote>/<branchName>
func RemoteBranches ¶
RemoteBranches returns the list of Remote branches found Formatted as <remote>/<branchName>
func RemoteExist ¶
RemoteExist return true if remote is defined.
func RemoteStatus ¶
RemoteStatus provide a sync status information
func SetLogFunc ¶
func SetLogFunc(aLogFunc func(string))
Define the internal Log system. By default it uses log.Print
Types ¶
type Status ¶
type Status struct {
Ready gitFiles
NotReady gitFiles
Err error
}
Status contains a representation of GIT status in porcelain mode.
func GetStatus ¶
func GetStatus() (gs *Status)
GetStatus return an GitStatus struct with the list of files, added, updated and
func (*Status) CountFiles ¶
CountFiles returns the number of files updated tracked or not.
func (*Status) CountTracked ¶
CountTracked returns the number of tracked files updated in ready or not ready area.
func (*Status) CountUntracked ¶
CountUntracked returns the number of tracked files updated in ready or not ready area.