func (r Repository) Delete() {
	os.RemoveAll(r.Path)
}
Delete deletes data on disk
package vcmock
import (
	"context"
	"errors"
	"fmt"
	"os"
	"path/filepath"
	git "github.com/go-git/go-git/v5"
	"github.com/lindell/multi-gitter/internal/scm"
)
type VersionController struct {
	PRNumber     int
	Repositories []Repository
	PullRequests []PullRequest
}
func (vc *VersionController) GetRepositories(ctx context.Context) ([]scm.Repository, error) {
	ret := make([]scm.Repository, len(vc.Repositories))
	for i := range vc.Repositories {
		ret[i] = vc.Repositories[i]
	}
	return ret, nil
}
func (vc *VersionController) CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, newPR scm.NewPullRequest) (scm.PullRequest, error) {
	repository := repo.(Repository)
	vc.PRNumber++
	pr := PullRequest{
		PRStatus:       scm.PullRequestStatusPending,
		PRNumber:       vc.PRNumber,
		Repository:     repository,
		NewPullRequest: newPR,
	}
	vc.PullRequests = append(vc.PullRequests, pr)
	return pr, nil
}
func (vc *VersionController) GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error) {
	ret := make([]scm.PullRequest, 0, len(vc.PullRequests))
	for _, pr := range vc.PullRequests {
		if pr.NewPullRequest.Head == branchName {
			ret = append(ret, pr)
		}
	}
	return ret, nil
}
func (vc *VersionController) MergePullRequest(ctx context.Context, pr scm.PullRequest) error {
	pullRequest := pr.(PullRequest)
	for i := range vc.PullRequests {
		if vc.PullRequests[i].Repository.FullName() == pullRequest.Repository.FullName() {
			vc.PullRequests[i].PRStatus = scm.PullRequestStatusMerged
			return nil
		}
	}
	return errors.New("could not find pull request")
}
func (vc *VersionController) ClosePullRequest(ctx context.Context, pr scm.PullRequest) error {
	pullRequest := pr.(PullRequest)
	for i := range vc.PullRequests {
		if vc.PullRequests[i].Repository.FullName() == pullRequest.Repository.FullName() {
			vc.PullRequests[i].PRStatus = scm.PullRequestStatusClosed
			return nil
		}
	}
	return errors.New("could not find pull request")
}
func (vc *VersionController) AddRepository(repo ...Repository) {
	vc.Repositories = append(vc.Repositories, repo...)
}
func (vc *VersionController) SetPRStatus(repoName string, branchName string, newStatus scm.PullRequestStatus) {
	for i := range vc.PullRequests {
		if vc.PullRequests[i].Repository.RepoName == repoName && vc.PullRequests[i].Head == branchName {
			vc.PullRequests[i].PRStatus = newStatus
		}
	}
}
func (vc *VersionController) GetAutocompleteOrganizations(ctx context.Context, str string) ([]string, error) {
	return []string{"static-org", str}, nil
}
func (vc *VersionController) GetAutocompleteUsers(ctx context.Context, str string) ([]string, error) {
	return []string{"static-user", str}, nil
}
func (vc *VersionController) GetAutocompleteRepositories(ctx context.Context, str string) ([]string, error) {
	return []string{"static-repo", str}, nil
}
func (vc *VersionController) ForkRepository(ctx context.Context, repo scm.Repository, newOwner string) (scm.Repository, error) {
	r := repo.(Repository)
	if newOwner == "" {
		newOwner = "default-owner"
	}
	newPath := fmt.Sprintf("%s-forked-%s", r.Path, newOwner)
	_, err := git.PlainCloneContext(ctx, newPath, false, &git.CloneOptions{
		URL: fmt.Sprintf(`file: 
	})
	if err != nil {
		return nil, err
	}
	return Repository{
		OwnerName: newOwner,
		RepoName:  r.RepoName,
		Path:      newPath,
	}, nil
}
func (vc *VersionController) Clean() {
	for _, repo := range vc.Repositories {
		repo.Delete()
	}
}
type PullRequest struct {
	PRStatus scm.PullRequestStatus
	PRNumber int
	Merged   bool
	Repository
	scm.NewPullRequest
}
func (pr PullRequest) Status() scm.PullRequestStatus {
	return pr.PRStatus
}
func (pr PullRequest) String() string {
	return fmt.Sprintf("%s #%d", pr.Repository.FullName(), pr.PRNumber)
}
type Repository struct {
	OwnerName string
	RepoName  string
	Path      string
}
func (r Repository) CloneURL() string {
	return fmt.Sprintf(`file: 
}
func (r Repository) DefaultBranch() string {
	return "master"
}
func (r Repository) FullName() string {
	return fmt.Sprintf("%s/%s", r.OwnerName, r.RepoName)
}
func (r Repository) Owner() string {
	return r.OwnerName
}