Documentation
¶
Index ¶
- Variables
- func Add(commander run.ICommander) (string, error)
- func CheckoutBranch(commander run.ICommander) (string, error)
- func CommitChanges(commander run.ICommander) (string, error)
- func DeleteBranch(commander run.ICommander) (string, error)
- func GetBranches(commander run.ICommander) ([]string, error)
- func GetCurrentBranch(branches []string) (string, error)
- func GetFilesOrNothingToCommit(s string) ([]string, bool)
- func GetFilesToBeCommitted(s string) []string
- func GetNotStagedFiles(s string) []string
- func Merge(commander run.ICommander) (string, error)
- func Push(commander run.ICommander) (string, error)
- func RemoveCurrentBranch(branches *[]string)
- func RemoveOriginHead(branches *[]string)
- func RemoveRemoteOriginFromName(branch *string)
- func SplitBranches(s string, removeCurrent bool) []string
- func Status(commander run.ICommander) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrBranchDoesNotExist = errors.New("Cannot checkout branch as it doesn't exist")
ErrBranchDoesNotExist is an error for when the branch asked to be checked out, doesn't exist
var ErrNoCurrentBranchFound = errors.New("no current branch found")
ErrNoCurrentBranchFound is an error returned when the input branches doesn't contain a current branch indicator
Functions ¶
func Add ¶
func Add(commander run.ICommander) (string, error)
Add will run git status and return the result
func CheckoutBranch ¶
func CheckoutBranch(commander run.ICommander) (string, error)
CheckoutBranch checks out a branch
func CommitChanges ¶
func CommitChanges(commander run.ICommander) (string, error)
CommitChanges will run git commit
func DeleteBranch ¶
func DeleteBranch(commander run.ICommander) (string, error)
DeleteBranch will run git delete for a branch
func GetBranches ¶
func GetBranches(commander run.ICommander) ([]string, error)
GetBranches gets all local branches
func GetCurrentBranch ¶
GetCurrentBranch takes a slice of branch names and returns the current branch based on which one starts with an *
func GetFilesOrNothingToCommit ¶
GetFilesOrNothingToCommit will return a slice of files that aren't tracked and if there is nothing to commit, a true flag
func GetFilesToBeCommitted ¶
GetFilesToBeCommitted will return a slice of strings from a git status result
func GetNotStagedFiles ¶
GetNotStagedFiles will return a slice of files that are not staged for commit
func Merge ¶
func Merge(commander run.ICommander) (string, error)
Merge will run git merge and return the result
func Push ¶
func Push(commander run.ICommander) (string, error)
Push will run a git push command and return the result
func RemoveCurrentBranch ¶
func RemoveCurrentBranch(branches *[]string)
RemoveCurrentBranch will remove the current branch from a list of branches
func RemoveOriginHead ¶
func RemoveOriginHead(branches *[]string)
RemoveOriginHead will remove a the head branch
func RemoveRemoteOriginFromName ¶
func RemoveRemoteOriginFromName(branch *string)
RemoveRemoteOriginFromName removes the remotes/origin part of the branch
func SplitBranches ¶
SplitBranches takes a string of branches with newline separators and splits them into a slice
Types ¶
This section is empty.