Documentation
¶
Index ¶
- func CloneRepository(remoteUrl, localPath, reference string) (*git.Repository, error)
- func FindRepositories(dirs []string) ([]*git.Repository, error)
- func IsRepository(path string) bool
- func LoadGitRepo(path string) (*git.Repository, error)
- func MirrorRepository(remoteFetchUrl, remotePushUrl, reference string) error
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneRepository ¶
func CloneRepository(remoteUrl, localPath, reference string) (*git.Repository, error)
func FindRepositories ¶
func FindRepositories(dirs []string) ([]*git.Repository, error)
FindRepositories finds all git repositories in the given folders. Goes to one level deep.
func IsRepository ¶
func LoadGitRepo ¶
func LoadGitRepo(path string) (*git.Repository, error)
func MirrorRepository ¶
Types ¶
type Wrapper ¶
type Wrapper interface {
// AddRemote adds a remote to the repo.
AddRemote(ctx context.Context, remoteName, remoteUrl string) error
// Fetch fetches the remote.
Fetch(ctx context.Context, remoteName string) error
// CheckoutBranch checks out the given branch.
CheckoutBranch(ctx context.Context, branchName string) error
// CommitAll commits all changes.
CommitAll(ctx context.Context, message string) error
// Status returns the status of the repo.
Status(ctx context.Context) error
// CreateBranch creates a new branch.
CreateBranch(ctx context.Context, branchName string) error
// DeleteBranch deletes the given branch.
DeleteBranch(ctx context.Context, branchName string) error
// Push pushes the given branch to the remote.
Push(ctx context.Context, remoteName, branchName string) error
// RunCommand runs the given git command.
RunCommand(ctx context.Context, command string, args []string) ([]byte, error)
}
func NewGitWrapper ¶
NewGitWrapper creates a new instance of Wrapper with the given repository.
Click to show internal directories.
Click to hide internal directories.