repo

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clone

type Clone struct {
	models.Repository
	TmpDir string

	FeatureBranch string
	DefaultBranch string
	// contains filtered or unexported fields
}

Clone is a local clone of a repository

func (*Clone) Add

func (c *Clone) Add(path string) error

Add adds a modified file to the staging area

func (*Clone) AddAll

func (c *Clone) AddAll() error

Add adds all modified files to the staging area

func (*Clone) AddFiles

func (c *Clone) AddFiles(clone *Clone, files []*PullRequestFileEntry) error

AddFiles copies a list of files into the clone filesystem. All

func (*Clone) AddRemote

func (c *Clone) AddRemote(name, url string) error

AddRemote adds a remote to the clone

func (*Clone) Cleanup

func (c *Clone) Cleanup()

CleanUp is intended to remove any temporary files lying around

func (*Clone) Commit

func (c *Clone) Commit(opts *options.CommitOptions) error

Commit creates a commit in the cloned repository. It expects files to be ready in the staging area.

func (*Clone) CreateFeatureBranch

func (c *Clone) CreateFeatureBranch() error

CreateFeatureBranch creates a branch in the local clone and switches to it.

func (*Clone) PushRemote

func (c *Clone) PushRemote(remoteName string) error

PushToRemote pushes the active branch to the specified remote

type OptFn

type OptFn func(*PullRequestManager)

func WithAuthenticator

func WithAuthenticator(a *auth.Authenticator) OptFn

type PullRequestFileEntry

type PullRequestFileEntry struct {
	// Path is the path where the data will be wirtten, relative to the clone fs root
	Path string

	// io Reader to read the file data
	Reader io.Reader
}

PullRequestFileEntry packs an io Reader and a path to write into a cloned repo

type PullRequestManager

type PullRequestManager struct {
	Options options.PullRequestManagerOptions
	// contains filtered or unexported fields
}

PullRequestManager is a tool to create and manage pull requests on a GitHub repository.

func NewPullRequestManager

func NewPullRequestManager(fn ...OptFn) *PullRequestManager

func (*PullRequestManager) CheckFork

func (prm *PullRequestManager) CheckFork(repo *models.Repository, forkName string) (*models.Repository, error)

CheckFork verifies that the logged in user has a fork of the specified repo. If a name is specified, then the function will look for a repo with a different name than the forked source.

func (*PullRequestManager) CloneRepo

func (prm *PullRequestManager) CloneRepo(repo *models.Repository) (*Clone, error)

CloneRepo clones the remote repository either to disk or to a memory filesystem

func (*PullRequestManager) CreatePullRequest

func (prm *PullRequestManager) CreatePullRequest(repo *models.Repository, opts *options.PullRequestOptions) (*models.PullRequest, error)

CreatePullRequest opens a pull request in a repository

func (*PullRequestManager) PullRequestFileList

func (prm *PullRequestManager) PullRequestFileList(
	repo *models.Repository, opts *options.PullRequestFileListOptions, files []*PullRequestFileEntry,
) (*models.PullRequest, error)

PullRequestFiles gets a list of files and opens a pull request in a repo to check them in. If the files already exist in the repo they will be updated with the new versions.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL