Documentation
¶
Index ¶
- func CreatePRURL(repo, branch string) string
- type Repository
- func (repo *Repository) CommitChanges(ctx context.Context, msg string) error
- func (repo *Repository) CreateBranch(branch string) error
- func (repo *Repository) CreatePR(ctx context.Context, branch, desc string) (string, error)
- func (repo *Repository) Name() string
- func (repo *Repository) Path() string
- func (repo *Repository) Push(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePRURL ¶
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository holds the state of a Git repository.
func Prepare ¶
func Prepare(ctx context.Context, name, dir, baseBranch string) (*Repository, error)
Prepare prepares the repo for use and returns a Repository instance. If the repo does not exist, it will be cloned to dir. Otherwise, any uncommitted changes will be discarded and the base branch will be updated.
func (*Repository) CommitChanges ¶
func (repo *Repository) CommitChanges(ctx context.Context, msg string) error
CommitChanges will stage all changes and commit them.
func (*Repository) CreateBranch ¶
func (repo *Repository) CreateBranch(branch string) error
CreateBranch creates a new branch and switches to it.
func (*Repository) Name ¶
func (repo *Repository) Name() string
Name returns the name of the repository.
func (*Repository) Path ¶
func (repo *Repository) Path() string
Path returns the path of the cloned repository on the OS filesystem.
Click to show internal directories.
Click to hide internal directories.