Documentation
¶
Index ¶
- type MergeConflictError
- type Repo
- func (r *Repo) BranchExists(name string) bool
- func (r *Repo) Checkout(ref string) error
- func (r *Repo) CreateBranch(name string, fromRef string) error
- func (r *Repo) CurrentBranch() (string, error)
- func (r *Repo) CurrentCommitSHA() (string, error)
- func (r *Repo) DeleteBranch(name string, force bool) error
- func (r *Repo) DeleteRemoteBranch(remoteName string, branchName string) error
- func (r *Repo) HasUncommittedChanges(branch string) (bool, error)
- func (r *Repo) IsDetachedHead() bool
- func (r *Repo) Merge(branch string, message string) error
- func (r *Repo) MergeAbort() error
- func (r *Repo) MergeSquash(branch string, message string) error
- func (r *Repo) Pull(remoteName string, branchName string) error
- func (r *Repo) Push(remoteName string, branchName string, force bool) error
- func (r *Repo) UserEmail() (string, error)
- func (r *Repo) UserName() (string, error)
- func (r *Repo) WorkingTree() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MergeConflictError ¶
MergeConflictError is returned when a merge results in conflicts
func (*MergeConflictError) Error ¶
func (e *MergeConflictError) Error() string
type Repo ¶
type Repo struct {
*git.Repository
// contains filtered or unexported fields
}
Repo wraps a git repository with helpful methods
func (*Repo) BranchExists ¶
BranchExists checks if a branch exists (local or remote)
func (*Repo) CreateBranch ¶
CreateBranch creates a new branch
func (*Repo) CurrentBranch ¶
CurrentBranch returns the name of the current branch
func (*Repo) CurrentCommitSHA ¶
CurrentCommitSHA returns the SHA of the current commit
func (*Repo) DeleteBranch ¶
DeleteBranch deletes a branch
func (*Repo) DeleteRemoteBranch ¶
DeleteRemoteBranch deletes a branch from remote
func (*Repo) HasUncommittedChanges ¶
HasUncommittedChanges checks if a branch has uncommitted changes Note: This requires executing git commands as go-git doesn't support this well
func (*Repo) IsDetachedHead ¶
IsDetachedHead checks if HEAD is in detached state
func (*Repo) Merge ¶
Merge merges a branch into the current branch with an optional message Note: This uses git command as go-git's merge support is limited
func (*Repo) MergeSquash ¶
MergeSquash squash merges a branch into the current branch
func (*Repo) WorkingTree ¶ added in v0.1.7
WorkingTree returns the working directory path of the repository