jx: github.com/jenkins-x/jx/pkg/gits Index | Files | Directories

package gits

import "github.com/jenkins-x/jx/pkg/gits"

Index

Package Files

bitbucket_cloud.go bitbucket_server.go commits.go constants.go credentials.go errors.go gerrit.go git_cli.go git_fake.go git_issues.go git_local.go git_repo.go git_url.go gitea.go github.go gitlab.go helpers.go interface.go provider.go provider_fake.go

Constants

const (
    // KindBitBucketCloud git kind for BitBucket Cloud
    KindBitBucketCloud = "bitbucketcloud"
    // KindBitBucketServer git kind for BitBucket Server
    KindBitBucketServer = "bitbucketserver"
    // KindGitea git kind for gitea
    KindGitea = "gitea"
    // KindGitlab git kind for gitlab
    KindGitlab = "gitlab"
    // KindGitHub git kind for github
    KindGitHub = "github"
    // KindGitFake git kind for fake git
    KindGitFake = "fakegit"
    // KindUnknown git kind for unknown git
    KindUnknown = "unknown"

    // BitbucketCloudURL the default URL for BitBucket Cloud
    BitbucketCloudURL = "https://bitbucket.org"

    // FakeGitURL the default URL for the fake git provider
    FakeGitURL = "https://fake.git"

    ProjectOpen   = "open"   // the state of an open project
    ProjectClosed = "closed" // the stat of a closed project
)
const (
    GitHubHost = "github.com"
    GitHubURL  = "https://github.com"
)
const (
    CommitStatusPending CommitStatus = "pending"
    CommitSatusSuccess               = "success"
    CommitStatusError                = "error"
    CommitStatusFailure              = "failure"
)
const (
    // LabelUpdatebot is the label applied to PRs created by updatebot
    LabelUpdatebot = "updatebot"
)

Variables

var (

    // ConventionalCommitTitles textual descriptions for
    // Conventional Commit types: https://conventionalcommits.org/
    ConventionalCommitTitles = map[string]*CommitGroup{
        "feat":     createCommitGroup("New Features"),
        "fix":      createCommitGroup("Bug Fixes"),
        "perf":     createCommitGroup("Performance Improvements"),
        "refactor": createCommitGroup("Code Refactoring"),
        "docs":     createCommitGroup("Documentation"),
        "test":     createCommitGroup("Tests"),
        "revert":   createCommitGroup("Reverts"),
        "style":    createCommitGroup("Styles"),
        "chore":    createCommitGroup("Chores"),
        "":         createCommitGroup(""),
    }
)
var (
    KindGits = []string{KindBitBucketCloud, KindBitBucketServer, KindGitea, KindGitHub, KindGitlab}
)
var (
    // PullRequestOpen is the state a pull request is in when it is open
    PullRequestOpen = "open"
)

func BitBucketCloudAccessTokenURL Uses

func BitBucketCloudAccessTokenURL(url string, username string) string

func BitBucketServerAccessTokenURL Uses

func BitBucketServerAccessTokenURL(url string) string

func EnsureUserAndEmailSetup Uses

func EnsureUserAndEmailSetup(gitter Gitter) (string, string, error)

EnsureUserAndEmailSetup returns the user name and email for the gitter lazily setting them if they are blank either from the environment variables `GIT_AUTHOR_NAME` and `GIT_AUTHOR_EMAIL` or using default values

func FetchAndMergeSHAs Uses

func FetchAndMergeSHAs(SHAs []string, baseBranch string, baseSha string, remote string, dir string,
    gitter Gitter) error

FetchAndMergeSHAs merges any SHAs into the baseBranch which has a tip of baseSha, fetching the commits from remote for the git repo in dir. It will try to fetch individual commits ( if the remote repo supports it - see https://github. com/git/git/commit/68ee628932c2196742b77d2961c5e16360734a62) otherwise it uses git remote update to pull down the whole repo.

func FindTagForVersion Uses

func FindTagForVersion(dir string, version string, gitter Gitter) (string, error)

FindTagForVersion will find a tag for a version number (first fetching the tags, then looking for a tag <version> then trying the common convention v<version>). It will return the tag or an error if the tag can't be found.

func ForkAndPullRepo Uses

func ForkAndPullRepo(gitURL string, dir string, baseRef string, branchName string, provider GitProvider, gitter Gitter, forkName string) (string, string, *GitRepository, *GitRepository, error)

ForkAndPullRepo pulls the specified gitUrl into dir using gitter, creating a remote fork if needed using the git provider

If there are existing files in dir (and dir is already a git clone), the existing files will pushed into the stash and then popped at the end. If they cannot be popped then an error will be returned which can be checked for using IsCouldNotPopTheStashError

func GenerateMarkdown Uses

func GenerateMarkdown(releaseSpec *v1.ReleaseSpec, gitInfo *GitRepository) (string, error)

GenerateMarkdown generates the markdown document for the commits

func GetGitInfoFromDirectory Uses

func GetGitInfoFromDirectory(dir string, gitter Gitter) (string, string, error)

GetGitInfoFromDirectory obtains remote origin HTTPS and current branch of a given directory and fails if it's not a git repository

func GetHost Uses

func GetHost(gitProvider GitProvider) (string, error)

GetHost returns the Git Provider hostname, e.g github.com

func GetOrganizations Uses

func GetOrganizations(orgLister OrganisationLister, userName string) []string

GetOrganizations gets the organisation

func GetOwner Uses

func GetOwner(batchMode bool, provider GitProvider, gitUsername string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (string, error)

func GetOwnerNamespaceID Uses

func GetOwnerNamespaceID(g *gitlab.Client, owner string) (int, error)

func GetRepoName Uses

func GetRepoName(batchMode, allowExistingRepo bool, provider GitProvider, defaultRepoName, owner string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (string, error)

func GitHubAccessTokenURL Uses

func GitHubAccessTokenURL(url string) string

func GitHubEnterpriseApiEndpointURL Uses

func GitHubEnterpriseApiEndpointURL(u string) string

func GitProviderURL Uses

func GitProviderURL(text string) string

GitProviderURL returns the git provider host URL for the SourceRepository which is something like either `https://hostname` or `http://hostname`

func GiteaAccessTokenURL Uses

func GiteaAccessTokenURL(url string) string

func GitlabAccessTokenURL Uses

func GitlabAccessTokenURL(url string) string

GitlabAccessTokenURL returns the URL to click on to generate a personal access token for the Git provider

func IsCouldNotPopTheStashError Uses

func IsCouldNotPopTheStashError(err error) bool

IsCouldNotPopTheStashError returns true if the error is due to the stash not being able to be popped, often because whatever is in the stash cannot be applied to the new state

func IsCouldntFindRemoteRefError Uses

func IsCouldntFindRemoteRefError(err error, ref string) bool

IsCouldntFindRemoteRefError returns true if the error is due to the remote ref not being found

func IsEmptyCommitError Uses

func IsEmptyCommitError(err error) bool

IsEmptyCommitError checks if the error during git rebase is caused by the commit being empty at the end of the cherry-pick

func IsGitHubServerURL Uses

func IsGitHubServerURL(u string) bool

func IsGitLabServerURL Uses

func IsGitLabServerURL(u string) bool

func IsGitRepoStatusFailed Uses

func IsGitRepoStatusFailed(statuses ...*GitRepoStatus) bool

IsGitRepoStatusFailed returns true if any of the statuses have failed

func IsGitRepoStatusSuccess Uses

func IsGitRepoStatusSuccess(statuses ...*GitRepoStatus) bool

IsGitRepoStatusSuccess returns true if all the statuses are successful

func IsNoStashEntriesError Uses

func IsNoStashEntriesError(err error) bool

IsNoStashEntriesError returns true if the error is due to no stash entries found

func IsOwnerGitHubUser Uses

func IsOwnerGitHubUser(owner string, gitHubUser string) bool

IsOwnerGitHubUser checks to see if the owner is the GitHub User

func IsRepositoryNotExportedError Uses

func IsRepositoryNotExportedError(err error) bool

IsRepositoryNotExportedError checks if the clone error happens because the repository is not exported

func IsUnadvertisedObjectError Uses

func IsUnadvertisedObjectError(err error) bool

IsUnadvertisedObjectError returns true if the reason for the error is that the request was for an object that is unadvertised (i.e. doesn't exist)

func PickOrganisation Uses

func PickOrganisation(orgLister OrganisationLister, userName string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (string, error)

PickOrganisation picks an organisations login if there is one available

func PickOwner Uses

func PickOwner(orgLister OrganisationLister, userName string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (string, error)

PickOwner allows to select a potential owner of a repository

func ProviderAccessTokenURL Uses

func ProviderAccessTokenURL(kind string, url string, username string) string

func SaasGitKind Uses

func SaasGitKind(gitServiceUrl string) string

SaasGitKind returns the kind for SaaS Git providers or "" if the URL could not be deduced

func SourceRepositoryProviderURL Uses

func SourceRepositoryProviderURL(gitProvider GitProvider) string

SourceRepositoryProviderURL returns the git provider URL for the SourceRepository which is something like either `https://hostname` or `http://hostname`

func Unshallow Uses

func Unshallow(dir string, gitter Gitter) error

Unshallow converts a shallow git repo (one cloned with --depth=n) into one has full depth for the current branch and all tags. Note that remote branches are still not fetched, you need to do this manually. It checks if the repo is shallow or not before trying to unshallow it.

type BitbucketCloudProvider Uses

type BitbucketCloudProvider struct {
    Client   *bitbucket.APIClient
    Username string
    Context  context.Context

    Server auth.AuthServer
    User   auth.UserAuth
    Git    Gitter
}

BitbucketCloudProvider implements GitProvider interface for bitbucket.org

func (*BitbucketCloudProvider) AcceptInvitation Uses

func (b *BitbucketCloudProvider) AcceptInvitation(ID int64) (*github.Response, error)

func (*BitbucketCloudProvider) AddCollaborator Uses

func (b *BitbucketCloudProvider) AddCollaborator(user string, organisation string, repo string) error

func (*BitbucketCloudProvider) AddLabelsToIssue Uses

func (b *BitbucketCloudProvider) AddLabelsToIssue(owner, repo string, number int, labels []string) error

AddLabelsToIssue adds labels to issues or pullrequests

func (*BitbucketCloudProvider) AddPRComment Uses

func (b *BitbucketCloudProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*BitbucketCloudProvider) BranchArchiveURL Uses

func (b *BitbucketCloudProvider) BranchArchiveURL(org string, name string, branch string) string

func (*BitbucketCloudProvider) ConfigureFeatures Uses

func (b *BitbucketCloudProvider) ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)

ConfigureFeatures sets specific features as enabled or disabled for owner/repo

func (*BitbucketCloudProvider) CreateIssue Uses

func (b *BitbucketCloudProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*BitbucketCloudProvider) CreateIssueComment Uses

func (b *BitbucketCloudProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

func (*BitbucketCloudProvider) CreatePullRequest Uses

func (b *BitbucketCloudProvider) CreatePullRequest(
    data *GitPullRequestArguments,
) (*GitPullRequest, error)

func (*BitbucketCloudProvider) CreateRepository Uses

func (b *BitbucketCloudProvider) CreateRepository(
    org string,
    name string,
    private bool,
) (*GitRepository, error)

func (*BitbucketCloudProvider) CreateWebHook Uses

func (b *BitbucketCloudProvider) CreateWebHook(data *GitWebHookArguments) error

func (*BitbucketCloudProvider) CurrentUsername Uses

func (b *BitbucketCloudProvider) CurrentUsername() string

CurrentUsername the current user name

func (*BitbucketCloudProvider) DeleteRepository Uses

func (b *BitbucketCloudProvider) DeleteRepository(org string, name string) error

func (*BitbucketCloudProvider) ForkRepository Uses

func (b *BitbucketCloudProvider) ForkRepository(
    originalOrg string,
    name string,
    destinationOrg string,
) (*GitRepository, error)

func (*BitbucketCloudProvider) GetBranch Uses

func (b *BitbucketCloudProvider) GetBranch(owner string, repo string, branch string) (*GitBranch, error)

GetBranch returns the branch information for an owner/repo, including the commit at the tip

func (*BitbucketCloudProvider) GetContent Uses

func (b *BitbucketCloudProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

func (*BitbucketCloudProvider) GetIssue Uses

func (b *BitbucketCloudProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*BitbucketCloudProvider) GetLatestRelease Uses

func (b *BitbucketCloudProvider) GetLatestRelease(org string, name string) (*GitRelease, error)

GetLatestRelease fetches the latest release from the git provider for org and name

func (*BitbucketCloudProvider) GetProjects Uses

func (b *BitbucketCloudProvider) GetProjects(owner string, repo string) ([]GitProject, error)

GetProjects returns all the git projects in owner/repo

func (*BitbucketCloudProvider) GetPullRequest Uses

func (b *BitbucketCloudProvider) GetPullRequest(owner string, repoInfo *GitRepository, number int) (*GitPullRequest, error)

GetPullRequest returns the PR

func (*BitbucketCloudProvider) GetPullRequestCommits Uses

func (b *BitbucketCloudProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)

func (*BitbucketCloudProvider) GetRelease Uses

func (b *BitbucketCloudProvider) GetRelease(org string, name string, tag string) (*GitRelease, error)

GetRelease is not supported on BitBucket Cloud

func (*BitbucketCloudProvider) GetRepository Uses

func (b *BitbucketCloudProvider) GetRepository(
    org string,
    name string,
) (*GitRepository, error)

func (*BitbucketCloudProvider) GitIssueToBitbucketIssue Uses

func (b *BitbucketCloudProvider) GitIssueToBitbucketIssue(gIssue GitIssue) bitbucket.Issue

func (*BitbucketCloudProvider) HasIssues Uses

func (b *BitbucketCloudProvider) HasIssues() bool

func (*BitbucketCloudProvider) IsBitbucketCloud Uses

func (b *BitbucketCloudProvider) IsBitbucketCloud() bool

func (*BitbucketCloudProvider) IsBitbucketServer Uses

func (b *BitbucketCloudProvider) IsBitbucketServer() bool

func (*BitbucketCloudProvider) IsGerrit Uses

func (b *BitbucketCloudProvider) IsGerrit() bool

func (*BitbucketCloudProvider) IsGitHub Uses

func (b *BitbucketCloudProvider) IsGitHub() bool

func (*BitbucketCloudProvider) IsGitea Uses

func (b *BitbucketCloudProvider) IsGitea() bool

func (*BitbucketCloudProvider) IsWikiEnabled Uses

func (b *BitbucketCloudProvider) IsWikiEnabled(owner string, repo string) (bool, error)

IsWikiEnabled returns true if a wiki is enabled for owner/repo

func (*BitbucketCloudProvider) IssueURL Uses

func (b *BitbucketCloudProvider) IssueURL(org string, name string, number int, isPull bool) string

IssueURL returns the issue URL

func (*BitbucketCloudProvider) JenkinsWebHookPath Uses

func (b *BitbucketCloudProvider) JenkinsWebHookPath(gitURL string, secret string) string

Exposed by Jenkins plugin; this one is for https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin

func (*BitbucketCloudProvider) Kind Uses

func (b *BitbucketCloudProvider) Kind() string

func (*BitbucketCloudProvider) Label Uses

func (b *BitbucketCloudProvider) Label() string

func (*BitbucketCloudProvider) ListCommitStatus Uses

func (b *BitbucketCloudProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

func (*BitbucketCloudProvider) ListCommits Uses

func (b *BitbucketCloudProvider) ListCommits(owner, repo string, opt *ListCommitsArguments) ([]*GitCommit, error)

ListCommits lists the commits for the specified repo and owner

func (*BitbucketCloudProvider) ListInvitations Uses

func (b *BitbucketCloudProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)

func (*BitbucketCloudProvider) ListOpenPullRequests Uses

func (b *BitbucketCloudProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

ListOpenPullRequests lists the open pull requests

func (*BitbucketCloudProvider) ListOrganisations Uses

func (b *BitbucketCloudProvider) ListOrganisations() ([]GitOrganisation, error)

func (*BitbucketCloudProvider) ListReleases Uses

func (b *BitbucketCloudProvider) ListReleases(org string, name string) ([]*GitRelease, error)

ListReleases lists the releases

func (*BitbucketCloudProvider) ListRepositories Uses

func (b *BitbucketCloudProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*BitbucketCloudProvider) ListWebHooks Uses

func (b *BitbucketCloudProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)

ListWebHooks lists the webhooks

func (*BitbucketCloudProvider) MergePullRequest Uses

func (b *BitbucketCloudProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*BitbucketCloudProvider) PullRequestLastCommitStatus Uses

func (b *BitbucketCloudProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*BitbucketCloudProvider) RenameRepository Uses

func (b *BitbucketCloudProvider) RenameRepository(
    org string,
    name string,
    newName string,
) (*GitRepository, error)

func (*BitbucketCloudProvider) SearchIssues Uses

func (b *BitbucketCloudProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)

func (*BitbucketCloudProvider) SearchIssuesClosedSince Uses

func (b *BitbucketCloudProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)

func (*BitbucketCloudProvider) ServerURL Uses

func (b *BitbucketCloudProvider) ServerURL() string

func (*BitbucketCloudProvider) ShouldForkForPullRequest Uses

func (b *BitbucketCloudProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request

func (*BitbucketCloudProvider) UpdateCommitStatus Uses

func (b *BitbucketCloudProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

func (*BitbucketCloudProvider) UpdatePullRequest Uses

func (b *BitbucketCloudProvider) UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

UpdatePullRequest updates pull request number with data

func (*BitbucketCloudProvider) UpdatePullRequestStatus Uses

func (b *BitbucketCloudProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*BitbucketCloudProvider) UpdateRelease Uses

func (b *BitbucketCloudProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

func (*BitbucketCloudProvider) UpdateReleaseStatus Uses

func (b *BitbucketCloudProvider) UpdateReleaseStatus(owner string, repo string, tag string, releaseInfo *GitRelease) error

UpdateReleaseStatus is not supported for this git provider

func (*BitbucketCloudProvider) UpdateWebHook Uses

func (b *BitbucketCloudProvider) UpdateWebHook(data *GitWebHookArguments) error

UpdateWebHook updates the webhook

func (*BitbucketCloudProvider) UploadReleaseAsset Uses

func (b *BitbucketCloudProvider) UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

UploadReleaseAsset will upload an asset to org/repo to a release with id, giving it a name, it will return the release asset from the git provider

func (*BitbucketCloudProvider) UserAuth Uses

func (b *BitbucketCloudProvider) UserAuth() auth.UserAuth

UserAuth returns the user auth

func (*BitbucketCloudProvider) UserInfo Uses

func (b *BitbucketCloudProvider) UserInfo(username string) *GitUser

UserInfo returns the user info

func (*BitbucketCloudProvider) ValidateRepositoryName Uses

func (b *BitbucketCloudProvider) ValidateRepositoryName(org string, name string) error

type BitbucketServerProvider Uses

type BitbucketServerProvider struct {
    Client   *bitbucket.APIClient
    Username string
    Context  context.Context

    Server auth.AuthServer
    User   auth.UserAuth
    Git    Gitter
}

BitbucketServerProvider implements GitProvider interface for a bitbucket server

func (*BitbucketServerProvider) AcceptInvitation Uses

func (b *BitbucketServerProvider) AcceptInvitation(ID int64) (*github.Response, error)

func (*BitbucketServerProvider) AddCollaborator Uses

func (b *BitbucketServerProvider) AddCollaborator(user string, organisation string, repo string) error

func (*BitbucketServerProvider) AddLabelsToIssue Uses

func (b *BitbucketServerProvider) AddLabelsToIssue(owner, repo string, number int, labels []string) error

AddLabelsToIssue adds labels to issues or pullrequests

func (*BitbucketServerProvider) AddPRComment Uses

func (b *BitbucketServerProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*BitbucketServerProvider) BranchArchiveURL Uses

func (b *BitbucketServerProvider) BranchArchiveURL(org string, name string, branch string) string

func (*BitbucketServerProvider) ConfigureFeatures Uses

func (b *BitbucketServerProvider) ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)

ConfigureFeatures sets specific features as enabled or disabled for owner/repo

func (*BitbucketServerProvider) CreateIssue Uses

func (b *BitbucketServerProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*BitbucketServerProvider) CreateIssueComment Uses

func (b *BitbucketServerProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

func (*BitbucketServerProvider) CreatePullRequest Uses

func (b *BitbucketServerProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)

func (*BitbucketServerProvider) CreateRepository Uses

func (b *BitbucketServerProvider) CreateRepository(org, name string, private bool) (*GitRepository, error)

func (*BitbucketServerProvider) CreateWebHook Uses

func (b *BitbucketServerProvider) CreateWebHook(data *GitWebHookArguments) error

CreateWebHook adds a new webhook to a git repository

func (*BitbucketServerProvider) CurrentUsername Uses

func (b *BitbucketServerProvider) CurrentUsername() string

func (*BitbucketServerProvider) DeleteRepository Uses

func (b *BitbucketServerProvider) DeleteRepository(org, name string) error

func (*BitbucketServerProvider) ForkRepository Uses

func (b *BitbucketServerProvider) ForkRepository(originalOrg, name, destinationOrg string) (*GitRepository, error)

func (*BitbucketServerProvider) GetBranch Uses

func (b *BitbucketServerProvider) GetBranch(owner string, repo string, branch string) (*GitBranch, error)

GetBranch returns the branch information for an owner/repo, including the commit at the tip

func (*BitbucketServerProvider) GetContent Uses

func (b *BitbucketServerProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

func (*BitbucketServerProvider) GetIssue Uses

func (b *BitbucketServerProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*BitbucketServerProvider) GetLatestRelease Uses

func (b *BitbucketServerProvider) GetLatestRelease(org string, name string) (*GitRelease, error)

GetLatestRelease fetches the latest release from the git provider for org and name

func (*BitbucketServerProvider) GetProjects Uses

func (b *BitbucketServerProvider) GetProjects(owner string, repo string) ([]GitProject, error)

GetProjects returns all the git projects in owner/repo

func (*BitbucketServerProvider) GetPullRequest Uses

func (b *BitbucketServerProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)

func (*BitbucketServerProvider) GetPullRequestCommits Uses

func (b *BitbucketServerProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)

func (*BitbucketServerProvider) GetRelease Uses

func (b *BitbucketServerProvider) GetRelease(org string, name string, tag string) (*GitRelease, error)

GetRelease is unsupported on bitbucket as releases are not supported

func (*BitbucketServerProvider) GetRepository Uses

func (b *BitbucketServerProvider) GetRepository(org string, name string) (*GitRepository, error)

func (*BitbucketServerProvider) HasIssues Uses

func (b *BitbucketServerProvider) HasIssues() bool

func (*BitbucketServerProvider) IsBitbucketCloud Uses

func (b *BitbucketServerProvider) IsBitbucketCloud() bool

func (*BitbucketServerProvider) IsBitbucketServer Uses

func (b *BitbucketServerProvider) IsBitbucketServer() bool

func (*BitbucketServerProvider) IsGerrit Uses

func (b *BitbucketServerProvider) IsGerrit() bool

func (*BitbucketServerProvider) IsGitHub Uses

func (b *BitbucketServerProvider) IsGitHub() bool

func (*BitbucketServerProvider) IsGitea Uses

func (b *BitbucketServerProvider) IsGitea() bool

func (*BitbucketServerProvider) IsWikiEnabled Uses

func (b *BitbucketServerProvider) IsWikiEnabled(owner string, repo string) (bool, error)

IsWikiEnabled returns true if a wiki is enabled for owner/repo

func (*BitbucketServerProvider) IssueURL Uses

func (b *BitbucketServerProvider) IssueURL(org string, name string, number int, isPull bool) string

func (*BitbucketServerProvider) JenkinsWebHookPath Uses

func (b *BitbucketServerProvider) JenkinsWebHookPath(gitURL string, secret string) string

Exposed by Jenkins plugin; this one is for https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin

func (*BitbucketServerProvider) Kind Uses

func (b *BitbucketServerProvider) Kind() string

func (*BitbucketServerProvider) Label Uses

func (b *BitbucketServerProvider) Label() string

func (*BitbucketServerProvider) ListCommitStatus Uses

func (b *BitbucketServerProvider) ListCommitStatus(org, repo, sha string) ([]*GitRepoStatus, error)

func (*BitbucketServerProvider) ListCommits Uses

func (b *BitbucketServerProvider) ListCommits(owner, repo string, opt *ListCommitsArguments) ([]*GitCommit, error)

ListCommits lists the commits for the specified repo and owner

func (*BitbucketServerProvider) ListInvitations Uses

func (b *BitbucketServerProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)

func (*BitbucketServerProvider) ListOpenPullRequests Uses

func (b *BitbucketServerProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

ListOpenPullRequests lists the open pull requests

func (*BitbucketServerProvider) ListOrganisations Uses

func (b *BitbucketServerProvider) ListOrganisations() ([]GitOrganisation, error)

func (*BitbucketServerProvider) ListReleases Uses

func (b *BitbucketServerProvider) ListReleases(org string, name string) ([]*GitRelease, error)

func (*BitbucketServerProvider) ListRepositories Uses

func (b *BitbucketServerProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*BitbucketServerProvider) ListWebHooks Uses

func (b *BitbucketServerProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)

ListWebHooks lists all of the webhooks on a given git repository

func (*BitbucketServerProvider) MergePullRequest Uses

func (b *BitbucketServerProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*BitbucketServerProvider) PullRequestLastCommitStatus Uses

func (b *BitbucketServerProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*BitbucketServerProvider) RenameRepository Uses

func (b *BitbucketServerProvider) RenameRepository(org, name, newName string) (*GitRepository, error)

func (*BitbucketServerProvider) SearchIssues Uses

func (b *BitbucketServerProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)

func (*BitbucketServerProvider) SearchIssuesClosedSince Uses

func (b *BitbucketServerProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)

func (*BitbucketServerProvider) ServerURL Uses

func (b *BitbucketServerProvider) ServerURL() string

func (*BitbucketServerProvider) ShouldForkForPullRequest Uses

func (b *BitbucketServerProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request

func (*BitbucketServerProvider) UpdateCommitStatus Uses

func (b *BitbucketServerProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

func (*BitbucketServerProvider) UpdatePullRequest Uses

func (b *BitbucketServerProvider) UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

UpdatePullRequest updates pull request number with data

func (*BitbucketServerProvider) UpdatePullRequestStatus Uses

func (b *BitbucketServerProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*BitbucketServerProvider) UpdateRelease Uses

func (b *BitbucketServerProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

func (*BitbucketServerProvider) UpdateReleaseStatus Uses

func (b *BitbucketServerProvider) UpdateReleaseStatus(owner string, repo string, tag string, releaseInfo *GitRelease) error

UpdateReleaseStatus is not supported for this git provider

func (*BitbucketServerProvider) UpdateWebHook Uses

func (b *BitbucketServerProvider) UpdateWebHook(data *GitWebHookArguments) error

UpdateWebHook is used to update a webhook on a git repository. It is best to pass in the webhook ID.

func (*BitbucketServerProvider) UploadReleaseAsset Uses

func (b *BitbucketServerProvider) UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

UploadReleaseAsset will upload an asset to org/repo to a release with id, giving it a name, it will return the release asset from the git provider

func (*BitbucketServerProvider) UserAuth Uses

func (b *BitbucketServerProvider) UserAuth() auth.UserAuth

func (*BitbucketServerProvider) UserInfo Uses

func (b *BitbucketServerProvider) UserInfo(username string) *GitUser

func (*BitbucketServerProvider) ValidateRepositoryName Uses

func (b *BitbucketServerProvider) ValidateRepositoryName(org, name string) error

type CommitGroup Uses

type CommitGroup struct {
    Title string
    Order int
}

func ConventionalCommitTypeToTitle Uses

func ConventionalCommitTypeToTitle(kind string) *CommitGroup

ConventionalCommitTypeToTitle returns the title of the conventional commit type see: https://conventionalcommits.org/

type CommitInfo Uses

type CommitInfo struct {
    Kind    string
    Feature string
    Message string
    // contains filtered or unexported fields
}

func ParseCommit Uses

func ParseCommit(message string) *CommitInfo

ParseCommit parses a conventional commit see: https://conventionalcommits.org/

func (*CommitInfo) Group Uses

func (c *CommitInfo) Group() *CommitGroup

func (*CommitInfo) Order Uses

func (c *CommitInfo) Order() int

func (*CommitInfo) Title Uses

func (c *CommitInfo) Title() string

type CommitStatus Uses

type CommitStatus string

type CreateRepoData Uses

type CreateRepoData struct {
    Organisation string
    RepoName     string
    FullName     string
    Public       bool
    User         *auth.UserAuth
    GitProvider  GitProvider
    GitServer    *auth.AuthServer
}

func PickNewGitRepository Uses

func PickNewGitRepository(batchMode bool, authConfigSvc auth.ConfigService, defaultRepoName string,
    repoOptions *GitRepositoryOptions, server *auth.AuthServer, userAuth *auth.UserAuth, git Gitter, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) (*CreateRepoData, error)

func PickNewOrExistingGitRepository Uses

func PickNewOrExistingGitRepository(batchMode bool, authConfigSvc auth.ConfigService, defaultRepoName string,
    repoOptions *GitRepositoryOptions, server *auth.AuthServer, userAuth *auth.UserAuth, git Gitter, allowExistingRepo bool, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (*CreateRepoData, error)

func (*CreateRepoData) CreateRepository Uses

func (d *CreateRepoData) CreateRepository() (*GitRepository, error)

CreateRepository creates the repository - failing if it already exists

func (*CreateRepoData) GetRepository Uses

func (d *CreateRepoData) GetRepository() (*GitRepository, error)

GetRepository returns the repository if it already exists

type FakeCommit Uses

type FakeCommit struct {
    Commit *GitCommit
    Status CommitStatus
}

type FakeIssue Uses

type FakeIssue struct {
    Issue   *GitIssue
    Comment string
}

type FakeProvider Uses

type FakeProvider struct {
    Server auth.AuthServer
    User   auth.UserAuth

    Organizations            []GitOrganisation
    Repositories             map[string][]*FakeRepository
    ForkedRepositories       map[string][]*FakeRepository
    Type                     FakeProviderType
    Users                    []*GitUser
    WebHooks                 []*GitWebHookArguments
    Gitter                   Gitter
    CreateRepositoryAddFiles func(dir string) error
}

func NewFakeProvider Uses

func NewFakeProvider(repositories ...*FakeRepository) *FakeProvider

NewFakeRepository creates a new fake repository

func (*FakeProvider) AcceptInvitation Uses

func (f *FakeProvider) AcceptInvitation(ID int64) (*github.Response, error)

func (*FakeProvider) AddCollaborator Uses

func (f *FakeProvider) AddCollaborator(user string, organisation string, repo string) error

func (*FakeProvider) AddLabelsToIssue Uses

func (f *FakeProvider) AddLabelsToIssue(owner, repo string, number int, labels []string) error

AddLabelsToIssue adds labels to an issue

func (*FakeProvider) AddPRComment Uses

func (f *FakeProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*FakeProvider) BranchArchiveURL Uses

func (f *FakeProvider) BranchArchiveURL(org string, name string, branch string) string

func (*FakeProvider) ConfigureFeatures Uses

func (f *FakeProvider) ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)

ConfigureFeatures sets specific features as enabled or disabled for owner/repo

func (*FakeProvider) CreateIssue Uses

func (f *FakeProvider) CreateIssue(owner string, repoName string, issue *GitIssue) (*GitIssue, error)

func (*FakeProvider) CreateIssueComment Uses

func (f *FakeProvider) CreateIssueComment(owner string, repoName string, number int, comment string) error

func (*FakeProvider) CreatePullRequest Uses

func (f *FakeProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)

func (*FakeProvider) CreateRepository Uses

func (f *FakeProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)

func (*FakeProvider) CreateWebHook Uses

func (f *FakeProvider) CreateWebHook(data *GitWebHookArguments) error

func (*FakeProvider) CurrentUsername Uses

func (f *FakeProvider) CurrentUsername() string

func (*FakeProvider) DeleteRepository Uses

func (f *FakeProvider) DeleteRepository(org string, name string) error

func (*FakeProvider) ForkRepository Uses

func (f *FakeProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)

func (*FakeProvider) GetBranch Uses

func (f *FakeProvider) GetBranch(owner string, repo string, branch string) (*GitBranch, error)

GetBranch returns the branch information for an owner/repo, including the commit at the tip

func (*FakeProvider) GetContent Uses

func (f *FakeProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

GetContent gets the content

func (*FakeProvider) GetIssue Uses

func (f *FakeProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*FakeProvider) GetLatestRelease Uses

func (f *FakeProvider) GetLatestRelease(org string, name string) (*GitRelease, error)

GetLatestRelease fetches the latest release from the git provider for org and name

func (*FakeProvider) GetProjects Uses

func (f *FakeProvider) GetProjects(owner string, repo string) ([]GitProject, error)

GetProjects returns all the git projects in owner/repo

func (*FakeProvider) GetPullRequest Uses

func (f *FakeProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)

func (*FakeProvider) GetPullRequestCommits Uses

func (f *FakeProvider) GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error)

func (*FakeProvider) GetRelease Uses

func (f *FakeProvider) GetRelease(org string, name string, tag string) (*GitRelease, error)

GetRelease returns the release info for the org, repository name and tag, or nil if no release is found

func (*FakeProvider) GetRepository Uses

func (f *FakeProvider) GetRepository(org string, name string) (*GitRepository, error)

func (*FakeProvider) HasIssues Uses

func (f *FakeProvider) HasIssues() bool

func (*FakeProvider) IsBitbucketCloud Uses

func (f *FakeProvider) IsBitbucketCloud() bool

func (*FakeProvider) IsBitbucketServer Uses

func (f *FakeProvider) IsBitbucketServer() bool

func (*FakeProvider) IsGerrit Uses

func (f *FakeProvider) IsGerrit() bool

func (*FakeProvider) IsGitHub Uses

func (f *FakeProvider) IsGitHub() bool

func (*FakeProvider) IsGitea Uses

func (f *FakeProvider) IsGitea() bool

func (*FakeProvider) IsWikiEnabled Uses

func (f *FakeProvider) IsWikiEnabled(owner string, repo string) (bool, error)

IsWikiEnabled returns true if a wiki is enabled for owner/repo

func (*FakeProvider) IssueURL Uses

func (f *FakeProvider) IssueURL(org string, name string, number int, isPull bool) string

func (*FakeProvider) JenkinsWebHookPath Uses

func (f *FakeProvider) JenkinsWebHookPath(gitURL string, secret string) string

func (*FakeProvider) Kind Uses

func (f *FakeProvider) Kind() string

func (*FakeProvider) Label Uses

func (f *FakeProvider) Label() string

func (*FakeProvider) ListCommitStatus Uses

func (f *FakeProvider) ListCommitStatus(org string, repoName string, sha string) ([]*GitRepoStatus, error)

func (*FakeProvider) ListCommits Uses

func (f *FakeProvider) ListCommits(owner, name string, opt *ListCommitsArguments) ([]*GitCommit, error)

ListCommits returns the list of commits in the master brach only (TODO: read opt param to apply to other branches)

func (*FakeProvider) ListInvitations Uses

func (f *FakeProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)

func (*FakeProvider) ListOpenPullRequests Uses

func (f *FakeProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

func (*FakeProvider) ListOrganisations Uses

func (f *FakeProvider) ListOrganisations() ([]GitOrganisation, error)

func (*FakeProvider) ListReleases Uses

func (f *FakeProvider) ListReleases(org string, name string) ([]*GitRelease, error)

func (*FakeProvider) ListRepositories Uses

func (f *FakeProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*FakeProvider) ListWebHooks Uses

func (p *FakeProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)

func (*FakeProvider) MergePullRequest Uses

func (f *FakeProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*FakeProvider) PullRequestLastCommitStatus Uses

func (f *FakeProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*FakeProvider) RenameRepository Uses

func (f *FakeProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)

func (*FakeProvider) SearchIssues Uses

func (f *FakeProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)

func (*FakeProvider) SearchIssuesClosedSince Uses

func (f *FakeProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)

func (*FakeProvider) ServerURL Uses

func (f *FakeProvider) ServerURL() string

func (*FakeProvider) ShouldForkForPullRequest Uses

func (f *FakeProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request

func (*FakeProvider) UpdateCommitStatus Uses

func (f *FakeProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

func (*FakeProvider) UpdatePullRequest Uses

func (f *FakeProvider) UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

UpdatePullRequest updates the pull request number with the new data

func (*FakeProvider) UpdatePullRequestStatus Uses

func (f *FakeProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*FakeProvider) UpdateRelease Uses

func (f *FakeProvider) UpdateRelease(owner string, repoName string, tag string, releaseInfo *GitRelease) error

func (*FakeProvider) UpdateReleaseStatus Uses

func (f *FakeProvider) UpdateReleaseStatus(owner string, repoName string, tag string, releaseInfo *GitRelease) error

UpdateReleaseStatus updates the status (release/prerelease) of a release

func (*FakeProvider) UpdateWebHook Uses

func (p *FakeProvider) UpdateWebHook(data *GitWebHookArguments) error

func (*FakeProvider) UploadReleaseAsset Uses

func (f *FakeProvider) UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

UploadReleaseAsset will upload an asset to org/repo to a release with id, giving it a name, it will return the release asset from the git provider

func (*FakeProvider) UserAuth Uses

func (f *FakeProvider) UserAuth() auth.UserAuth

func (*FakeProvider) UserInfo Uses

func (f *FakeProvider) UserInfo(username string) *GitUser

func (*FakeProvider) ValidateRepositoryName Uses

func (f *FakeProvider) ValidateRepositoryName(org string, name string) error

type FakeProviderType Uses

type FakeProviderType int
const (
    GitHub FakeProviderType = iota
    Gitlab
    Gitea
    BitbucketCloud
    BitbucketServer
    Gerrit
    Fake
)

type FakePullRequest Uses

type FakePullRequest struct {
    PullRequest *GitPullRequest
    Commits     []*FakeCommit
    Comment     string
}

type FakeRepository Uses

type FakeRepository struct {
    Owner        string
    GitRepo      *GitRepository
    PullRequests map[int]*FakePullRequest
    Issues       map[int]*FakeIssue
    Commits      []*FakeCommit

    Releases           map[string]*GitRelease
    PullRequestCounter int
    BaseDir            string
    CloneDir           string
    Projects           []GitProject
    WikiEnabled        bool
    // contains filtered or unexported fields
}

func NewFakeRepository Uses

func NewFakeRepository(owner string, repoName string, addFiles func(dir string) error, gitter Gitter) (*FakeRepository, error)

NewFakeRepository creates a new fake repository

func (*FakeRepository) Name Uses

func (r *FakeRepository) Name() string

func (*FakeRepository) String Uses

func (r *FakeRepository) String() string

type GerritProvider Uses

type GerritProvider struct {
    Client   *gerrit.Client
    Username string
    Context  context.Context

    Server auth.AuthServer
    User   auth.UserAuth
    Git    Gitter
}

func (*GerritProvider) AcceptInvitation Uses

func (p *GerritProvider) AcceptInvitation(ID int64) (*github.Response, error)

func (*GerritProvider) AddCollaborator Uses

func (p *GerritProvider) AddCollaborator(user string, organisation string, repo string) error

func (*GerritProvider) AddLabelsToIssue Uses

func (p *GerritProvider) AddLabelsToIssue(owner, repo string, number int, labels []string) error

AddLabelsToIssue adds labels to issues or pullrequests

func (*GerritProvider) AddPRComment Uses

func (p *GerritProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*GerritProvider) BranchArchiveURL Uses

func (p *GerritProvider) BranchArchiveURL(org string, name string, branch string) string

func (*GerritProvider) ConfigureFeatures Uses

func (p *GerritProvider) ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)

ConfigureFeatures sets specific features as enabled or disabled for owner/repo

func (*GerritProvider) CreateIssue Uses

func (p *GerritProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*GerritProvider) CreateIssueComment Uses

func (p *GerritProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

func (*GerritProvider) CreatePullRequest Uses

func (p *GerritProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)

func (*GerritProvider) CreateRepository Uses

func (p *GerritProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)

func (*GerritProvider) CreateWebHook Uses

func (p *GerritProvider) CreateWebHook(data *GitWebHookArguments) error

func (*GerritProvider) CurrentUsername Uses

func (p *GerritProvider) CurrentUsername() string

func (*GerritProvider) DeleteRepository Uses

func (p *GerritProvider) DeleteRepository(org string, name string) error

func (*GerritProvider) ForkRepository Uses

func (p *GerritProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)

func (*GerritProvider) GetBranch Uses

func (p *GerritProvider) GetBranch(owner string, repo string, branch string) (*GitBranch, error)

GetBranch returns the branch information for an owner/repo, including the commit at the tip

func (*GerritProvider) GetContent Uses

func (p *GerritProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

func (*GerritProvider) GetIssue Uses

func (p *GerritProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*GerritProvider) GetLatestRelease Uses

func (p *GerritProvider) GetLatestRelease(org string, name string) (*GitRelease, error)

GetLatestRelease fetches the latest release from the git provider for org and name

func (*GerritProvider) GetProjects Uses

func (p *GerritProvider) GetProjects(owner string, repo string) ([]GitProject, error)

GetProjects returns all the git projects in owner/repo

func (*GerritProvider) GetPullRequest Uses

func (p *GerritProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)

func (*GerritProvider) GetPullRequestCommits Uses

func (p *GerritProvider) GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error)

func (*GerritProvider) GetRelease Uses

func (p *GerritProvider) GetRelease(org string, name string, tag string) (*GitRelease, error)

GetRelease returns the release info for org, repo name and tag

func (*GerritProvider) GetRepository Uses

func (p *GerritProvider) GetRepository(org string, name string) (*GitRepository, error)

func (*GerritProvider) HasIssues Uses

func (p *GerritProvider) HasIssues() bool

func (*GerritProvider) IsBitbucketCloud Uses

func (p *GerritProvider) IsBitbucketCloud() bool

func (*GerritProvider) IsBitbucketServer Uses

func (p *GerritProvider) IsBitbucketServer() bool

func (*GerritProvider) IsGerrit Uses

func (p *GerritProvider) IsGerrit() bool

func (*GerritProvider) IsGitHub Uses

func (p *GerritProvider) IsGitHub() bool

func (*GerritProvider) IsGitea Uses

func (p *GerritProvider) IsGitea() bool

func (*GerritProvider) IsWikiEnabled Uses

func (p *GerritProvider) IsWikiEnabled(owner string, repo string) (bool, error)

IsWikiEnabled returns true if a wiki is enabled for owner/repo

func (*GerritProvider) IssueURL Uses

func (p *GerritProvider) IssueURL(org string, name string, number int, isPull bool) string

func (*GerritProvider) JenkinsWebHookPath Uses

func (p *GerritProvider) JenkinsWebHookPath(gitURL string, secret string) string

func (*GerritProvider) Kind Uses

func (p *GerritProvider) Kind() string

func (*GerritProvider) Label Uses

func (p *GerritProvider) Label() string

func (*GerritProvider) ListCommitStatus Uses

func (p *GerritProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

func (*GerritProvider) ListCommits Uses

func (p *GerritProvider) ListCommits(owner, repo string, opt *ListCommitsArguments) ([]*GitCommit, error)

func (*GerritProvider) ListInvitations Uses

func (p *GerritProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)

func (*GerritProvider) ListOpenPullRequests Uses

func (p *GerritProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

ListOpenPullRequests lists the open pull requests

func (*GerritProvider) ListOrganisations Uses

func (p *GerritProvider) ListOrganisations() ([]GitOrganisation, error)

ListOrganisations lists all organizations the configured user has access to.

func (*GerritProvider) ListReleases Uses

func (p *GerritProvider) ListReleases(org string, name string) ([]*GitRelease, error)

func (*GerritProvider) ListRepositories Uses

func (p *GerritProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*GerritProvider) ListWebHooks Uses

func (p *GerritProvider) ListWebHooks(org, repo string) ([]*GitWebHookArguments, error)

ListWebHooks lists all webhooks for the specified repo.

func (*GerritProvider) MergePullRequest Uses

func (p *GerritProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*GerritProvider) PullRequestLastCommitStatus Uses

func (p *GerritProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*GerritProvider) RenameRepository Uses

func (p *GerritProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)

func (*GerritProvider) SearchIssues Uses

func (p *GerritProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)

func (*GerritProvider) SearchIssuesClosedSince Uses

func (p *GerritProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)

func (*GerritProvider) ServerURL Uses

func (p *GerritProvider) ServerURL() string

func (*GerritProvider) ShouldForkForPullRequest Uses

func (p *GerritProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request

func (*GerritProvider) UpdateCommitStatus Uses

func (p *GerritProvider) UpdateCommitStatus(org, repo, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

UpdateCommitStatus updates the status of a specified commit in a specified repo.

func (*GerritProvider) UpdatePullRequest Uses

func (p *GerritProvider) UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

UpdatePullRequest updates pull request with number using data

func (*GerritProvider) UpdatePullRequestStatus Uses

func (p *GerritProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*GerritProvider) UpdateRelease Uses

func (p *GerritProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

func (*GerritProvider) UpdateReleaseStatus Uses

func (p *GerritProvider) UpdateReleaseStatus(owner string, repo string, tag string, releaseInfo *GitRelease) error

UpdateReleaseStatus is not supported for this git provider

func (*GerritProvider) UpdateWebHook Uses

func (p *GerritProvider) UpdateWebHook(data *GitWebHookArguments) error

UpdateWebHook update a webhook with the data specified.

func (*GerritProvider) UploadReleaseAsset Uses

func (p *GerritProvider) UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

UploadReleaseAsset will upload an asset to org/repo to a release with id, giving it a name, it will return the release asset from the git provider

func (*GerritProvider) UserAuth Uses

func (p *GerritProvider) UserAuth() auth.UserAuth

func (*GerritProvider) UserInfo Uses

func (p *GerritProvider) UserInfo(username string) *GitUser

func (*GerritProvider) ValidateRepositoryName Uses

func (p *GerritProvider) ValidateRepositoryName(org string, name string) error

type GitBranch Uses

type GitBranch struct {
    Name      string
    Commit    *GitCommit
    Protected bool
}

GitBranch is info on a git branch including the commit at the tip

type GitCLI Uses

type GitCLI struct{}

GitCLI implements common git actions based on git CLI

func NewGitCLI Uses

func NewGitCLI() *GitCLI

NewGitCLI creates a new GitCLI instance

func (*GitCLI) Add Uses

func (g *GitCLI) Add(dir string, args ...string) error

Add does a git add for all the given arguments

func (*GitCLI) AddCommit Uses

func (g *GitCLI) AddCommit(dir string, msg string) error

AddCommit perform an add and commit of the changes from the repository at the given directory with the given messages

func (*GitCLI) AddRemote Uses

func (g *GitCLI) AddRemote(dir string, name string, url string) error

AddRemote adds a remote repository at the given URL and with the given name

func (*GitCLI) Branch Uses

func (g *GitCLI) Branch(dir string) (string, error)

Branch returns the current branch of the repository located at the given directory

func (*GitCLI) Checkout Uses

func (g *GitCLI) Checkout(dir string, branch string) error

Checkout checks out the given branch

func (*GitCLI) CheckoutOrphan Uses

func (g *GitCLI) CheckoutOrphan(dir string, branch string) error

Checkout checks out the given branch

func (*GitCLI) CheckoutRemoteBranch Uses

func (g *GitCLI) CheckoutRemoteBranch(dir string, branch string) error

CheckoutRemoteBranch checks out the given remote tracking branch

func (*GitCLI) CherryPick Uses

func (g *GitCLI) CherryPick(dir string, commitish string) error

CherryPick does a git cherry-pick of commit

func (*GitCLI) CleanForce Uses

func (g *GitCLI) CleanForce(dir, fileName string) error

Clean force cleans a git repository located at a given directory

func (*GitCLI) Clone Uses

func (g *GitCLI) Clone(url string, dir string) error

Clone clones the given git URL into the given directory

func (*GitCLI) CloneBare Uses

func (g *GitCLI) CloneBare(dir string, url string) error

CloneBare will create a bare clone of url

func (*GitCLI) CloneOrPull Uses

func (g *GitCLI) CloneOrPull(url string, dir string) error

CloneOrPull clones the given git URL or pull if it already exists

func (*GitCLI) CommitDir Uses

func (g *GitCLI) CommitDir(dir string, message string) error

CommitDir commits all changes from the given directory

func (*GitCLI) CommitIfChanges Uses

func (g *GitCLI) CommitIfChanges(dir string, message string) error

CommiIfChanges does a commit if there are any changes in the repository at the given directory

func (*GitCLI) ConvertToValidBranchName Uses

func (g *GitCLI) ConvertToValidBranchName(name string) string

ConvertToValidBranchName converts the given branch name into a valid git branch string replacing any dodgy characters

func (*GitCLI) CreateAuthenticatedURL Uses

func (g *GitCLI) CreateAuthenticatedURL(cloneURL string, userAuth *auth.UserAuth) (string, error)

CreateAuthenticatedURL creates the Git repository URL with the username and password encoded for HTTPS based URLs

func (*GitCLI) CreateBranch Uses

func (g *GitCLI) CreateBranch(dir string, branch string) error

CreateBranch creates a branch with the given name in the Git repository from the given directory

func (*GitCLI) CreateBranchFrom Uses

func (g *GitCLI) CreateBranchFrom(dir string, branchName string, startPoint string) error

CreateBranchFrom creates a new branch called branchName from startPoint

func (*GitCLI) CreateTag Uses

func (g *GitCLI) CreateTag(dir string, tag string, msg string) error

CreateTag creates a tag with the given name and message in the repository at the given directory

func (*GitCLI) DeleteRemoteBranch Uses

func (g *GitCLI) DeleteRemoteBranch(dir string, remoteName string, branch string) error

DeleteRemoteBranch deletes the remote branch in the given given directory

func (*GitCLI) Diff Uses

func (g *GitCLI) Diff(dir string) (string, error)

Diff runs git diff

func (*GitCLI) DiscoverRemoteGitURL Uses

func (g *GitCLI) DiscoverRemoteGitURL(gitConf string) (string, error)

DiscoverRemoteGitURL discovers the remote git URL from the given git configuration

func (*GitCLI) DiscoverUpstreamGitURL Uses

func (g *GitCLI) DiscoverUpstreamGitURL(gitConf string) (string, error)

DiscoverUpstreamGitURL discovers the upstream git URL from the given git configuration

func (*GitCLI) Email Uses

func (g *GitCLI) Email(dir string) (string, error)

Email returns the email from the git configuration

func (*GitCLI) FetchBranch Uses

func (g *GitCLI) FetchBranch(dir string, repo string, refspecs ...string) error

FetchBranch fetches the refspecs from the repo

func (*GitCLI) FetchBranchShallow Uses

func (g *GitCLI) FetchBranchShallow(dir string, repo string, refspecs ...string) error

FetchBranchShallow fetches the refspecs from the repo

func (*GitCLI) FetchBranchUnshallow Uses

func (g *GitCLI) FetchBranchUnshallow(dir string, repo string, refspecs ...string) error

FetchBranch fetches the refspecs from the repo

func (*GitCLI) FetchTags Uses

func (g *GitCLI) FetchTags(dir string) error

FetchTags fetches all the tags

func (*GitCLI) FetchUnshallow Uses

func (g *GitCLI) FetchUnshallow(dir string) error

FetchUnshallow runs git fetch --unshallow in dir

func (*GitCLI) FilterTags Uses

func (g *GitCLI) FilterTags(dir string, filter string) ([]string, error)

FilterTags returns all tags from the repository at the given directory that match the filter

func (*GitCLI) FindGitConfigDir Uses

func (g *GitCLI) FindGitConfigDir(dir string) (string, string, error)

FindGitConfigDir tries to find the `.git` directory either in the current directory or in parent directories

func (*GitCLI) ForcePushBranch Uses

func (g *GitCLI) ForcePushBranch(dir string, localBranch string, remoteBranch string) error

ForcePushBranch does a force push of the local branch into the remote branch of the repository at the given directory

func (*GitCLI) GetAuthorEmailForCommit Uses

func (g *GitCLI) GetAuthorEmailForCommit(dir string, sha string) (string, error)

GetAuthorEmailForCommit returns the author email from commit message with the given SHA

func (*GitCLI) GetCommitPointedToByLatestTag Uses

func (g *GitCLI) GetCommitPointedToByLatestTag(dir string) (string, string, error)

GetCommitPointedToByLatestTag return the SHA of the commit pointed to by the latest git tag as well as the tag name for the git repo in dir

func (*GitCLI) GetCommitPointedToByPreviousTag Uses

func (g *GitCLI) GetCommitPointedToByPreviousTag(dir string) (string, string, error)

GetCommitPointedToByPreviousTag return the SHA of the commit pointed to by the latest-but-1 git tag as well as the tag name for the git repo in dir

func (*GitCLI) GetCommits Uses

func (g *GitCLI) GetCommits(dir string, startSha string, endSha string) ([]GitCommit, error)

GetCommits returns the commits in a range, exclusive of startSha and inclusive of endSha

func (*GitCLI) GetCommitsNotOnAnyRemote Uses

func (g *GitCLI) GetCommitsNotOnAnyRemote(dir string, branch string) ([]GitCommit, error)

func (*GitCLI) GetLatestCommitMessage Uses

func (g *GitCLI) GetLatestCommitMessage(dir string) (string, error)

GetLatestCommitMessage returns the latest git commit message

func (*GitCLI) GetLatestCommitSha Uses

func (g *GitCLI) GetLatestCommitSha(dir string) (string, error)

GetLatestCommitSha returns the sha of the last commit

func (*GitCLI) GetRemoteUrl Uses

func (g *GitCLI) GetRemoteUrl(config *gitcfg.Config, name string) string

GetRemoteUrl returns the remote URL from the given git config

func (*GitCLI) GetRevisionBeforeDate Uses

func (g *GitCLI) GetRevisionBeforeDate(dir string, t time.Time) (string, error)

GetRevisionBeforeDate returns the revision before the given date

func (*GitCLI) GetRevisionBeforeDateText Uses

func (g *GitCLI) GetRevisionBeforeDateText(dir string, dateText string) (string, error)

GetRevisionBeforeDateText returns the revision before the given date in format "MonthName dayNumber year"

func (*GitCLI) HasChanges Uses

func (g *GitCLI) HasChanges(dir string) (bool, error)

HasChanges indicates if there are any changes in the repository from the given directory

func (*GitCLI) Info Uses

func (g *GitCLI) Info(dir string) (*GitRepository, error)

Info returns the git info of the repository at the given directory

func (*GitCLI) Init Uses

func (g *GitCLI) Init(dir string) error

Init inits a git repository into the given directory

func (*GitCLI) IsFork Uses

func (g *GitCLI) IsFork(dir string) (bool, error)

IsFork indicates if the repository at the given directory is a fork

func (*GitCLI) IsShallow Uses

func (g *GitCLI) IsShallow(dir string) (bool, error)

IsShallow runs git rev-parse --is-shallow-repository in dir and returns the result

func (*GitCLI) ListChangedFilesFromBranch Uses

func (g *GitCLI) ListChangedFilesFromBranch(dir string, branch string) (string, error)

ListChangedFilesFromBranch lists files changed between branches

func (*GitCLI) LoadFileFromBranch Uses

func (g *GitCLI) LoadFileFromBranch(dir string, branch string, file string) (string, error)

LoadFileFromBranch returns a files's contents from a branch

func (*GitCLI) LocalBranches Uses

func (g *GitCLI) LocalBranches(dir string) ([]string, error)

LocalBranches will list all local branches

func (*GitCLI) Merge Uses

func (g *GitCLI) Merge(dir string, commitish string) error

Merge merges the commitish into the current branch

func (*GitCLI) MergeTheirs Uses

func (g *GitCLI) MergeTheirs(dir string, commitish string) error

MergeTheirs will do a recursive merge of commitish with the strategy option theirs

func (*GitCLI) NthTag Uses

func (g *GitCLI) NthTag(dir string, n int) (string, string, error)

NthTag return the SHA and tag name of nth tag in reverse chronological order from the repository at the given directory. If the nth tag does not exist empty strings without an error are returned.

func (*GitCLI) PrintCreateRepositoryGenerateAccessToken Uses

func (g *GitCLI) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)

PrintCreateRepositoryGenerateAccessToken prints the access token URL of a Git repository

func (*GitCLI) Pull Uses

func (g *GitCLI) Pull(dir string) error

Pull pulls the Git repository in the given directory

func (*GitCLI) PullRemoteBranches Uses

func (g *GitCLI) PullRemoteBranches(dir string) error

PullRemoteBranches pulls the remote Git tags from the given given directory

func (*GitCLI) PullUpstream Uses

func (g *GitCLI) PullUpstream(dir string) error

PullUpstream pulls the remote upstream branch into master branch into the given directory

func (*GitCLI) Push Uses

func (g *GitCLI) Push(dir string, remote string, force bool, setUpstream bool, refspec ...string) error

Push pushes the changes from the repository at the given directory

func (*GitCLI) PushMaster Uses

func (g *GitCLI) PushMaster(dir string) error

PushMaster pushes the master branch into the origin, setting the upstream

func (*GitCLI) PushMirror Uses

func (g *GitCLI) PushMirror(dir string, url string) error

PushMirror will push the dir as a mirror to url

func (*GitCLI) PushTag Uses

func (g *GitCLI) PushTag(dir string, tag string) error

Pushtag pushes the given tag into the origin

func (*GitCLI) RebaseTheirs Uses

func (g *GitCLI) RebaseTheirs(dir string, upstream string, branch string, skipEmpty bool) error

RebaseTheirs runs git rebase upstream branch with the strategy option theirs

func (*GitCLI) RemoteBranchNames Uses

func (g *GitCLI) RemoteBranchNames(dir string, prefix string) ([]string, error)

RemoteBranches returns all remote branches with the given prefix

func (*GitCLI) RemoteBranches Uses

func (g *GitCLI) RemoteBranches(dir string) ([]string, error)

RemoteBranches returns the remote branches

func (*GitCLI) RemoteUpdate Uses

func (g *GitCLI) RemoteUpdate(dir string) error

RemoteUpdate performs a git remote update

func (*GitCLI) Remotes Uses

func (g *GitCLI) Remotes(dir string) ([]string, error)

Remotes will list the names of the remotes

func (*GitCLI) Remove Uses

func (g *GitCLI) Remove(dir, fileName string) error

Remove removes the given file from a Git repository located at the given directory

func (*GitCLI) RemoveForce Uses

func (g *GitCLI) RemoveForce(dir, fileName string) error

Remove force removes the given file from a git repository located at the given directory

func (*GitCLI) RepoName Uses

func (g *GitCLI) RepoName(org, repoName string) string

RepoName formats the repository names based on the organization

func (*GitCLI) Reset Uses

func (g *GitCLI) Reset(dir string, commitish string, hard bool) error

Reset performs a git reset --hard back to the commitish specified

func (*GitCLI) ResetToUpstream Uses

func (g *GitCLI) ResetToUpstream(dir string, branch string) error

ResetToUpstream resets the given branch to the upstream version

func (*GitCLI) RevParse Uses

func (g *GitCLI) RevParse(dir string, rev string) (string, error)

RevParse runs git rev-parse on rev

func (*GitCLI) Server Uses

func (g *GitCLI) Server(dir string) (string, error)

Server returns the Git server of the repository at the given directory

func (*GitCLI) SetEmail Uses

func (g *GitCLI) SetEmail(dir string, email string) error

SetEmail sets the given email in the git configuration

func (*GitCLI) SetRemoteURL Uses

func (g *GitCLI) SetRemoteURL(dir string, name string, gitURL string) error

SetRemoteURL sets the remote URL of the remote with the given name

func (*GitCLI) SetUpstreamTo Uses

func (g *GitCLI) SetUpstreamTo(dir string, branch string) error

SetUpstreamTo will set the given branch to track the origin branch with the same name

func (*GitCLI) SetUsername Uses

func (g *GitCLI) SetUsername(dir string, username string) error

SetUsername sets the username in the git configuration

func (*GitCLI) ShallowClone Uses

func (g *GitCLI) ShallowClone(dir string, url string, commitish string, pullRequest string) error

ShallowClone shallow clones the repo at url from the specified commitish or pull request to a local master branch

func (*GitCLI) ShallowCloneBranch Uses

func (g *GitCLI) ShallowCloneBranch(gitURL string, branch string, dir string) error

Clone clones a single branch of the given git URL into the given directory

func (*GitCLI) StashPop Uses

func (g *GitCLI) StashPop(dir string) error

StashPop applies the last stash , will error if there is no stash. Error can be checked using IsNoStashEntriesError

func (*GitCLI) StashPush Uses

func (g *GitCLI) StashPush(dir string) error

StashPush stashes the current changes from the given directory

func (*GitCLI) Status Uses

func (g *GitCLI) Status(dir string) error

Status returns the status of the git repository at the given directory

func (*GitCLI) Tags Uses

func (g *GitCLI) Tags(dir string) ([]string, error)

Tags returns all tags from the repository at the given directory

func (*GitCLI) UpdateRemote Uses

func (g *GitCLI) UpdateRemote(dir, url string) error

UpdateRemote updates the URL of the remote repository

func (*GitCLI) Username Uses

func (g *GitCLI) Username(dir string) (string, error)

Username return the username from the git configuration

func (*GitCLI) Version Uses

func (g *GitCLI) Version() (string, error)

Version returns the git version

func (*GitCLI) WriteOperation Uses

func (g *GitCLI) WriteOperation(dir string, args ...string) error

WriteOperation performs a generic write operation, with nicer error handling

type GitCommit Uses

type GitCommit struct {
    SHA       string
    Message   string
    Author    *GitUser
    URL       string
    Branch    string
    Committer *GitUser
}

func (*GitCommit) OneLine Uses

func (c *GitCommit) OneLine() string

OneLine returns the commit in the Oneline format

func (*GitCommit) ShortSha Uses

func (c *GitCommit) ShortSha() string

ShortSha returns short SHA of the commit.

func (*GitCommit) Subject Uses

func (c *GitCommit) Subject() string

Subject returns the subject line of the commit message.

type GitFake Uses

type GitFake struct {
    GitRemotes     []GitRemote
    Branches       []string
    BranchesRemote []string
    CurrentBranch  string
    AccessTokenURL string
    RepoInfo       GitRepository
    Fork           bool
    GitVersion     string
    GitUser        GitUser
    Commits        []GitCommit
    Changes        bool
    GitTags        []GitTag
    Revision       string
    // contains filtered or unexported fields
}

GitFake provides a fake Gitter

func (*GitFake) Add Uses

func (g *GitFake) Add(dir string, args ...string) error

Add add files to git

func (*GitFake) AddCommit Uses

func (g *GitFake) AddCommit(dir string, msg string) error

AddCommit add a commit

func (*GitFake) AddRemote Uses

func (g *GitFake) AddRemote(dir string, name string, url string) error

AddRemote adds a remote

func (*GitFake) Branch Uses

func (g *GitFake) Branch(dir string) (string, error)

Branch returns the current branch

func (*GitFake) Checkout Uses

func (g *GitFake) Checkout(dir string, branch string) error

Checkout checkout the branch

func (*GitFake) CheckoutOrphan Uses

func (g *GitFake) CheckoutOrphan(dir string, branch string) error

CheckoutOrphan checkout the orphan

func (*GitFake) CheckoutRemoteBranch Uses

func (g *GitFake) CheckoutRemoteBranch(dir string, branch string) error

CheckoutRemoteBranch checkout remote branch

func (*GitFake) CherryPick Uses

func (g *GitFake) CherryPick(dir string, commit string) error

CherryPick does a git cherry-pick of commit

func (*GitFake) CleanForce Uses

func (g *GitFake) CleanForce(dir string, fileName string) error

CleanForce clean force

func (*GitFake) Clone Uses

func (g *GitFake) Clone(url string, directory string) error

Clone clones the repo to the given dir

func (*GitFake) CloneBare Uses

func (g *GitFake) CloneBare(dir string, url string) error

CloneBare does nothing

func (*GitFake) CloneOrPull Uses

func (g *GitFake) CloneOrPull(url string, directory string) error

CloneOrPull performs a clone or pull

func (*GitFake) CommitDir Uses

func (g *GitFake) CommitDir(dir string, message string) error

CommitDir commit a dir

func (*GitFake) CommitIfChanges Uses

func (g *GitFake) CommitIfChanges(dir string, message string) error

CommitIfChanges git commit if there are changes

func (*GitFake) ConvertToValidBranchName Uses

func (g *GitFake) ConvertToValidBranchName(name string) string

ConvertToValidBranchName converts the name to a valid branch name

func (*GitFake) CreateAuthenticatedURL Uses

func (g *GitFake) CreateAuthenticatedURL(cloneURL string, userAuth *auth.UserAuth) (string, error)

CreateAuthenticatedURL creates a Push URL

func (*GitFake) CreateBranch Uses

func (g *GitFake) CreateBranch(dir string, branch string) error

CreateBranch creates a branch

func (*GitFake) CreateBranchFrom Uses

func (g *GitFake) CreateBranchFrom(dir string, branchName string, startPoint string) error

CreateBranchFrom creates a new branch called branchName from startPoint

func (*GitFake) CreateTag Uses

func (g *GitFake) CreateTag(dir string, tag string, msg string) error

CreateTag creates a tag

func (*GitFake) DeleteRemoteBranch Uses

func (g *GitFake) DeleteRemoteBranch(dir string, remoteName string, branch string) error

DeleteRemoteBranch deletes a remote branch

func (*GitFake) Diff Uses

func (g *GitFake) Diff(dir string) (string, error)

Diff performs a git diff

func (*GitFake) DiscoverRemoteGitURL Uses

func (g *GitFake) DiscoverRemoteGitURL(gitConf string) (string, error)

DiscoverRemoteGitURL discover the remote git URL

func (*GitFake) DiscoverUpstreamGitURL Uses

func (g *GitFake) DiscoverUpstreamGitURL(gitConf string) (string, error)

DiscoverUpstreamGitURL discover the upstream git URL

func (*GitFake) Email Uses

func (g *GitFake) Email(dir string) (string, error)

Email returns the current user git email address

func (*GitFake) FetchBranch Uses

func (g *GitFake) FetchBranch(dir string, repo string, refspec ...string) error

FetchBranch fetch branch

func (*GitFake) FetchBranchShallow Uses

func (g *GitFake) FetchBranchShallow(dir string, repo string, refspec ...string) error

FetchBranchShallow fetch branch

func (*GitFake) FetchBranchUnshallow Uses

func (g *GitFake) FetchBranchUnshallow(dir string, repo string, refspec ...string) error

FetchBranch fetch branch

func (*GitFake) FetchTags Uses

func (g *GitFake) FetchTags(dir string) error

FetchTags fetches tags

func (*GitFake) FetchUnshallow Uses

func (g *GitFake) FetchUnshallow(dir string) error

FetchUnshallow deepens a shallow git clone

func (*GitFake) FilterTags Uses

func (g *GitFake) FilterTags(dir string, filter string) ([]string, error)

FilterTags returns all tags from the repository at the given directory that match the filter

func (*GitFake) FindGitConfigDir Uses

func (g *GitFake) FindGitConfigDir(dir string) (string, string, error)

FindGitConfigDir finds the git config dir

func (*GitFake) ForcePushBranch Uses

func (g *GitFake) ForcePushBranch(dir string, localBranch string, remoteBranch string) error

ForcePushBranch force push a branch

func (*GitFake) GetAuthorEmailForCommit Uses

func (g *GitFake) GetAuthorEmailForCommit(dir string, sha string) (string, error)

GetAuthorEmailForCommit returns the author email for a commit

func (*GitFake) GetCommitPointedToByLatestTag Uses

func (g *GitFake) GetCommitPointedToByLatestTag(dir string) (string, string, error)

GetCommitPointedToByLatestTag returns the current git tag sha

func (*GitFake) GetCommitPointedToByPreviousTag Uses

func (g *GitFake) GetCommitPointedToByPreviousTag(dir string) (string, string, error)

GetCommitPointedToByPreviousTag returns the previous git tag SHA

func (*GitFake) GetCommits Uses

func (g *GitFake) GetCommits(dir string, startSha string, endSha string) ([]GitCommit, error)

GetCommits returns the commits in a range, exclusive of startSha and inclusive of endSha

func (*GitFake) GetCommitsNotOnAnyRemote Uses

func (g *GitFake) GetCommitsNotOnAnyRemote(dir string, branch string) ([]GitCommit, error)

GetCommitsNotOnAnyRemote returns a list of commits which are on branch but not present on a remote

func (*GitFake) GetLatestCommitMessage Uses

func (g *GitFake) GetLatestCommitMessage(dir string) (string, error)

GetLatestCommitMessage returns the last commit message

func (*GitFake) GetLatestCommitSha Uses

func (g *GitFake) GetLatestCommitSha(dir string) (string, error)

GetLatestCommitSha returns the sha of the last commit

func (*GitFake) GetRemoteUrl Uses

func (g *GitFake) GetRemoteUrl(config *gitcfg.Config, name string) string

GetRemoteUrl get the remote URL

func (*GitFake) GetRevisionBeforeDate Uses

func (g *GitFake) GetRevisionBeforeDate(dir string, t time.Time) (string, error)

GetRevisionBeforeDate get the revision before the date

func (*GitFake) GetRevisionBeforeDateText Uses

func (g *GitFake) GetRevisionBeforeDateText(dir string, dateText string) (string, error)

GetRevisionBeforeDateText get the revision before the date text

func (*GitFake) HasChanges Uses

func (g *GitFake) HasChanges(dir string) (bool, error)

HasChanges returns true if has changes in git

func (*GitFake) Info Uses

func (g *GitFake) Info(dir string) (*GitRepository, error)

Info returns the git repo info

func (*GitFake) Init Uses

func (g *GitFake) Init(dir string) error

Init initialises git in a dir

func (*GitFake) IsFork Uses

func (g *GitFake) IsFork(dir string) (bool, error)

IsFork returns trie if this repo is a fork

func (*GitFake) IsShallow Uses

func (g *GitFake) IsShallow(dir string) (bool, error)

IsShallow returns false

func (*GitFake) ListChangedFilesFromBranch Uses

func (g *GitFake) ListChangedFilesFromBranch(dir string, branch string) (string, error)

ListChangedFilesFromBranch lists changes files between current checkout and a branch

func (*GitFake) LoadFileFromBranch Uses

func (g *GitFake) LoadFileFromBranch(dir string, branch string, file string) (string, error)

LoadFileFromBranch returns a files's contents from a branch

func (*GitFake) LocalBranches Uses

func (g *GitFake) LocalBranches(dir string) ([]string, error)

LocalBranches will list all local branches

func (*GitFake) Merge Uses

func (g *GitFake) Merge(dir string, commitish string) error

Merge merges the commitish into the current branch

func (*GitFake) MergeTheirs Uses

func (g *GitFake) MergeTheirs(dir string, commitish string) error

MergeTheirs does nothing

func (*GitFake) PrintCreateRepositoryGenerateAccessToken Uses

func (g *GitFake) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)

PrintCreateRepositoryGenerateAccessToken prints the generate access token URL

func (*GitFake) Pull Uses

func (g *GitFake) Pull(dir string) error

Pull git pulls

func (*GitFake) PullRemoteBranches Uses

func (g *GitFake) PullRemoteBranches(dir string) error

PullRemoteBranches pull remote branches

func (*GitFake) PullUpstream Uses

func (g *GitFake) PullUpstream(dir string) error

PullUpstream pulls upstream

func (*GitFake) Push Uses

func (g *GitFake) Push(dir string, remote string, force bool, setUpstream bool, refspec ...string) error

Push performs a git push

func (*GitFake) PushMaster Uses

func (g *GitFake) PushMaster(dir string) error

PushMaster pushes to master

func (*GitFake) PushMirror Uses

func (g *GitFake) PushMirror(dir string, url string) error

PushMirror does nothing

func (*GitFake) PushTag Uses

func (g *GitFake) PushTag(dir string, tag string) error

PushTag pushes a tag

func (*GitFake) RebaseTheirs Uses

func (g *GitFake) RebaseTheirs(dir string, upstream string, branch string, skipEmpty bool) error

RebaseTheirs does nothing

func (*GitFake) RemoteBranchNames Uses

func (g *GitFake) RemoteBranchNames(dir string, prefix string) ([]string, error)

RemoteBranchNames list the remote branch names

func (*GitFake) RemoteBranches Uses

func (g *GitFake) RemoteBranches(dir string) ([]string, error)

RemoteBranches list the remote branches

func (*GitFake) RemoteUpdate Uses

func (g *GitFake) RemoteUpdate(dir string) error

RemoteUpdate performs a git remote update

func (*GitFake) Remotes Uses

func (g *GitFake) Remotes(dir string) ([]string, error)

Remotes will list the names of the remotes

func (*GitFake) Remove Uses

func (g *GitFake) Remove(dir string, fileName string) error

Remove a file from git

func (*GitFake) RemoveForce Uses

func (g *GitFake) RemoveForce(dir string, fileName string) error

RemoveForce remove force

func (*GitFake) RepoName Uses

func (g *GitFake) RepoName(org string, repoName string) string

RepoName returns the repo name

func (*GitFake) Reset Uses

func (g *GitFake) Reset(dir string, commitish string, hard bool) error

Reset performs a git reset --hard back to the commitish specified

func (*GitFake) ResetToUpstream Uses

func (g *GitFake) ResetToUpstream(dir string, branch string) error

ResetToUpstream resets the given branch to the upstream version

func (*GitFake) RevParse Uses

func (g *GitFake) RevParse(dir string, rev string) (string, error)

RevParse runs git rev-parse on rev

func (*GitFake) Server Uses

func (g *GitFake) Server(dir string) (string, error)

Server returns the server URL

func (*GitFake) SetEmail Uses

func (g *GitFake) SetEmail(dir string, email string) error

SetEmail sets the git email address

func (*GitFake) SetRemoteURL Uses

func (g *GitFake) SetRemoteURL(dir string, name string, gitURL string) error

SetRemoteURL sets a remote URL

func (*GitFake) SetUpstreamTo Uses

func (g *GitFake) SetUpstreamTo(dir string, branch string) error

SetUpstreamTo will set the given branch to track the origin branch with the same name

func (*GitFake) SetUsername Uses

func (g *GitFake) SetUsername(dir string, username string) error

SetUsername sets the username

func (*GitFake) ShallowClone Uses

func (g *GitFake) ShallowClone(dir string, url string, commitish string, pullRequest string) error

ShallowClone shallow clones the repo at url from the specified commitish or pull request to a local master branch

func (*GitFake) ShallowCloneBranch Uses

func (g *GitFake) ShallowCloneBranch(url string, branch string, directory string) error

ShallowCloneBranch shallow clone of a branch

func (*GitFake) StashPop Uses

func (g *GitFake) StashPop(dir string) error

StashPop does nothing

func (*GitFake) StashPush Uses

func (g *GitFake) StashPush(dir string) error

StashPush git stash

func (*GitFake) Status Uses

func (g *GitFake) Status(dir string) error

Status check the status

func (*GitFake) Tags Uses

func (g *GitFake) Tags(dir string) ([]string, error)

Tags lists the tags

func (*GitFake) UpdateRemote Uses

func (g *GitFake) UpdateRemote(dir string, url string) error

UpdateRemote updates a remote

func (*GitFake) Username Uses

func (g *GitFake) Username(dir string) (string, error)

Username returns the current user name

func (*GitFake) Version Uses

func (g *GitFake) Version() (string, error)

Version returns the git version

type GitFileContent Uses

type GitFileContent struct {
    Type        string
    Encoding    string
    Size        int
    Name        string
    Path        string
    Content     string
    Sha         string
    Url         string
    GitUrl      string
    HtmlUrl     string
    DownloadUrl string
}

type GitHubProvider Uses

type GitHubProvider struct {
    Username string
    Client   *github.Client
    Context  context.Context

    Server auth.AuthServer
    User   auth.UserAuth
    Git    Gitter
}

func (*GitHubProvider) AcceptInvitation Uses

func (p *GitHubProvider) AcceptInvitation(ID int64) (*github.Response, error)

func (*GitHubProvider) AddCollaborator Uses

func (p *GitHubProvider) AddCollaborator(user string, organisation string, repo string) error

func (*GitHubProvider) AddLabelsToIssue Uses

func (p *GitHubProvider) AddLabelsToIssue(owner string, repo string, number int, labels []string) error

AddLabelsToIssue adds labels to an issue

func (*GitHubProvider) AddPRComment Uses

func (p *GitHubProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*GitHubProvider) BranchArchiveURL Uses

func (p *GitHubProvider) BranchArchiveURL(org string, name string, branch string) string

func (*GitHubProvider) ConfigureFeatures Uses

func (p *GitHubProvider) ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)

ConfigureFeatures sets specific features as enabled or disabled for owner/repo

func (*GitHubProvider) CreateIssue Uses

func (p *GitHubProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*GitHubProvider) CreateIssueComment Uses

func (p *GitHubProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

func (*GitHubProvider) CreatePullRequest Uses

func (p *GitHubProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)

func (*GitHubProvider) CreateRepository Uses

func (p *GitHubProvider) CreateRepository(owner string, name string, private bool) (*GitRepository, error)

CreateRepository creates a new repository under owner/name, optionally private

func (*GitHubProvider) CreateWebHook Uses

func (p *GitHubProvider) CreateWebHook(data *GitWebHookArguments) error

func (*GitHubProvider) CurrentUsername Uses

func (p *GitHubProvider) CurrentUsername() string

func (*GitHubProvider) DeleteRepository Uses

func (p *GitHubProvider) DeleteRepository(org string, name string) error

func (*GitHubProvider) ForkRepository Uses

func (p *GitHubProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)

func (*GitHubProvider) GetBranch Uses

func (p *GitHubProvider) GetBranch(owner string, repo string, branch string) (*GitBranch, error)

GetBranch returns the branch information for an owner/repo, including the commit at the tip

func (*GitHubProvider) GetContent Uses

func (p *GitHubProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

func (*GitHubProvider) GetEnterpriseApiURL Uses

func (p *GitHubProvider) GetEnterpriseApiURL() string

GetEnterpriseApiURL returns the github enterprise API URL or blank if this provider is for the https://github.com service

func (*GitHubProvider) GetIssue Uses

func (p *GitHubProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*GitHubProvider) GetLatestRelease Uses

func (p *GitHubProvider) GetLatestRelease(org string, name string) (*GitRelease, error)

GetLatestRelease fetches the latest release from the git provider for org and name

func (*GitHubProvider) GetProjects Uses

func (p *GitHubProvider) GetProjects(owner string, repo string) ([]GitProject, error)

GetProjects returns all the git projects in owner/repo

func (*GitHubProvider) GetPullRequest Uses

func (p *GitHubProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)

func (*GitHubProvider) GetPullRequestCommits Uses

func (p *GitHubProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)

func (*GitHubProvider) GetRelease Uses

func (p *GitHubProvider) GetRelease(org string, name string, tag string) (*GitRelease, error)

GetRelease gets the release info for org, repo name and tag

func (*GitHubProvider) GetRepository Uses

func (p *GitHubProvider) GetRepository(org string, name string) (*GitRepository, error)

func (*GitHubProvider) HasIssues Uses

func (p *GitHubProvider) HasIssues() bool

func (*GitHubProvider) IsBitbucketCloud Uses

func (p *GitHubProvider) IsBitbucketCloud() bool

func (*GitHubProvider) IsBitbucketServer Uses

func (p *GitHubProvider) IsBitbucketServer() bool

func (*GitHubProvider) IsGerrit Uses

func (p *GitHubProvider) IsGerrit() bool

func (*GitHubProvider) IsGitHub Uses

func (p *GitHubProvider) IsGitHub() bool

func (*GitHubProvider) IsGitea Uses

func (p *GitHubProvider) IsGitea() bool

func (*GitHubProvider) IsUserInOrganisation Uses

func (p *GitHubProvider) IsUserInOrganisation(user string, org string) (bool, error)

func (*GitHubProvider) IsWikiEnabled Uses

func (p *GitHubProvider) IsWikiEnabled(owner string, repo string) (bool, error)

IsWikiEnabled returns true if a wiki is enabled for owner/repo

func (*GitHubProvider) IssueURL Uses

func (p *GitHubProvider) IssueURL(org string, name string, number int, isPull bool) string

func (*GitHubProvider) JenkinsWebHookPath Uses

func (p *GitHubProvider) JenkinsWebHookPath(gitURL string, secret string) string

func (*GitHubProvider) Kind Uses

func (p *GitHubProvider) Kind() string

func (*GitHubProvider) Label Uses

func (p *GitHubProvider) Label() string

func (*GitHubProvider) ListCommitStatus Uses

func (p *GitHubProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

func (*GitHubProvider) ListCommits Uses

func (p *GitHubProvider) ListCommits(owner, repo string, opt *ListCommitsArguments) ([]*GitCommit, error)

func (*GitHubProvider) ListInvitations Uses

func (p *GitHubProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)

func (*GitHubProvider) ListOpenPullRequests Uses

func (p *GitHubProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

ListOpenPullRequests lists the open pull requests

func (*GitHubProvider) ListOrganisations Uses

func (p *GitHubProvider) ListOrganisations() ([]GitOrganisation, error)

func (*GitHubProvider) ListReleases Uses

func (p *GitHubProvider) ListReleases(org string, name string) ([]*GitRelease, error)

func (*GitHubProvider) ListRepositories Uses

func (p *GitHubProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*GitHubProvider) ListRepositoriesForUser Uses

func (p *GitHubProvider) ListRepositoriesForUser(user string) ([]*GitRepository, error)

func (*GitHubProvider) ListWebHooks Uses

func (p *GitHubProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)

func (*GitHubProvider) MergePullRequest Uses

func (p *GitHubProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*GitHubProvider) PullRequestLastCommitStatus Uses

func (p *GitHubProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*GitHubProvider) RenameRepository Uses

func (p *GitHubProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)

func (*GitHubProvider) SearchIssues Uses

func (p *GitHubProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, error)

func (*GitHubProvider) SearchIssuesClosedSince Uses

func (p *GitHubProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)

func (*GitHubProvider) ServerURL Uses

func (p *GitHubProvider) ServerURL() string

func (*GitHubProvider) ShouldForkForPullRequest Uses

func (p *GitHubProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

ShouldForkForPullRequest returns true if we should create a personal fork of this repository before creating a pull request

func (*GitHubProvider) UpdateCommitStatus Uses

func (p *GitHubProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

func (*GitHubProvider) UpdatePullRequest Uses

func (p *GitHubProvider) UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

UpdatePullRequest updates pull request with number using data

func (*GitHubProvider) UpdatePullRequestStatus Uses

func (p *GitHubProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*GitHubProvider) UpdateRelease Uses

func (p *GitHubProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

func (*GitHubProvider) UpdateReleaseStatus Uses

func (p *GitHubProvider) UpdateReleaseStatus(owner string, repo string, tag string, releaseInfo *GitRelease) error

UpdateReleaseStatus updates the state (release/prerelease) of a release

func (*GitHubProvider) UpdateWebHook Uses

func (p *GitHubProvider) UpdateWebHook(data *GitWebHookArguments) error

func (*GitHubProvider) UploadReleaseAsset Uses

func (p *GitHubProvider) UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

UploadReleaseAsset will upload an asset to org/repo to a release with id, giving it a name, it will return the release asset from the git provider

func (*GitHubProvider) UserAuth Uses

func (p *GitHubProvider) UserAuth() auth.UserAuth

func (*GitHubProvider) UserInfo Uses

func (p *GitHubProvider) UserInfo(username string) *GitUser

func (*GitHubProvider) ValidateRepositoryName Uses

func (p *GitHubProvider) ValidateRepositoryName(org string, name string) error

type GitIssue Uses

type GitIssue struct {
    URL           string
    Owner         string
    Repo          string
    Number        *int
    Key           string
    Title         string
    Body          string
    State         *string
    Labels        []GitLabel
    StatusesURL   *string
    IssueURL      *string
    CreatedAt     *time.Time
    UpdatedAt     *time.Time
    ClosedAt      *time.Time
    IsPullRequest bool
    User          *GitUser
    ClosedBy      *GitUser
    Assignees     []GitUser
}

func BitbucketIssueToGitIssue Uses

func BitbucketIssueToGitIssue(bIssue bitbucket.Issue) *GitIssue

func FilterIssuesClosedSince Uses

func FilterIssuesClosedSince(issues []*GitIssue, t time.Time) []*GitIssue

FilterIssuesClosedSince returns a filtered slice of all the issues closed since the given date

func (*GitIssue) IsClosedSince Uses

func (i *GitIssue) IsClosedSince(t time.Time) bool

IsClosedSince returns true if the issue has been closed since the given da

func (*GitIssue) Name Uses

func (i *GitIssue) Name() string

Name returns the textual name of the issue

type GitLabel Uses

type GitLabel struct {
    URL   string
    Name  string
    Color string
}

func ToGitLabels Uses

func ToGitLabels(names []string) []GitLabel

ToGitLabels converts the list of label names into an array of GitLabels

type GitLocal Uses

type GitLocal struct {
    GitCLI  *GitCLI
    GitFake *GitFake
}

GitLocal provides a semi-fake Gitter - local operations delegate to GitCLI but remote operations are delegated to FakeGit. When using it in tests you must make sure you are operating on a temporary copy of a git repo NOT the real one on your disk (as it will get changed!). Faked out methods have the comment "Faked out"

func NewGitLocal Uses

func NewGitLocal() *GitLocal

NewGitLocal creates a new GitLocal instance

func (*GitLocal) Add Uses

func (g *GitLocal) Add(dir string, args ...string) error

Add does a git add for all the given arguments

func (*GitLocal) AddCommit Uses

func (g *GitLocal) AddCommit(dir string, msg string) error

AddCommit perform an add and commit of the changes from the repository at the given directory with the given messages

func (*GitLocal) AddRemote Uses

func (g *GitLocal) AddRemote(dir string, name string, url string) error

AddRemote adds a remote repository at the given URL and with the given name

func (*GitLocal) Branch Uses

func (g *GitLocal) Branch(dir string) (string, error)

Branch returns the current branch of the repository located at the given directory

func (*GitLocal) Checkout Uses

func (g *GitLocal) Checkout(dir string, branch string) error

Checkout checks out the given branch

func (*GitLocal) CheckoutOrphan Uses

func (g *GitLocal) CheckoutOrphan(dir string, branch string) error

CheckoutOrphan checks out the given branch as an orphan

func (*GitLocal) CheckoutRemoteBranch Uses

func (g *GitLocal) CheckoutRemoteBranch(dir string, branch string) error

CheckoutRemoteBranch checks out the given remote tracking branch

func (*GitLocal) CherryPick Uses

func (g *GitLocal) CherryPick(dir string, commit string) error

CherryPick does a git cherry-pick of commit

func (*GitLocal) CleanForce Uses

func (g *GitLocal) CleanForce(dir, fileName string) error

CleanForce cleans a git repository located at a given directory

func (*GitLocal) Clone Uses

func (g *GitLocal) Clone(url string, dir string) error

Clone clones the given git URL into the given directory Faked out

func (*GitLocal) CloneBare Uses

func (g *GitLocal) CloneBare(dir string, url string) error

CloneBare does nothing

func (*GitLocal) CloneOrPull Uses

func (g *GitLocal) CloneOrPull(url string, dir string) error

CloneOrPull clones the given git URL or pull if it already exists Faked out

func (*GitLocal) CommitDir Uses

func (g *GitLocal) CommitDir(dir string, message string) error

CommitDir commits all changes from the given directory

func (*GitLocal) CommitIfChanges Uses

func (g *GitLocal) CommitIfChanges(dir string, message string) error

CommitIfChanges does a commit if there are any changes in the repository at the given directory

func (*GitLocal) ConvertToValidBranchName Uses

func (g *GitLocal) ConvertToValidBranchName(name string) string

ConvertToValidBranchName converts the given branch name into a valid git branch string replacing any dodgy characters

func (*GitLocal) CreateAuthenticatedURL Uses

func (g *GitLocal) CreateAuthenticatedURL(cloneURL string, userAuth *auth.UserAuth) (string, error)

CreateAuthenticatedURL creates the Git repository URL with the username and password encoded for HTTPS based URLs

func (*GitLocal) CreateBranch Uses

func (g *GitLocal) CreateBranch(dir string, branch string) error

CreateBranch creates a branch with the given name in the Git repository from the given directory

func (*GitLocal) CreateBranchFrom Uses

func (g *GitLocal) CreateBranchFrom(dir string, branchName string, startPoint string) error

CreateBranchFrom creates a new branch called branchName from startPoint

func (*GitLocal) CreateTag Uses

func (g *GitLocal) CreateTag(dir string, tag string, msg string) error

CreateTag creates a tag with the given name and message in the repository at the given directory

func (*GitLocal) DeleteRemoteBranch Uses

func (g *GitLocal) DeleteRemoteBranch(dir string, remoteName string, branch string) error

DeleteRemoteBranch deletes the remote branch in the given given directory Faked out

func (*GitLocal) Diff Uses

func (g *GitLocal) Diff(dir string) (string, error)

Diff runs git diff

func (*GitLocal) DiscoverRemoteGitURL Uses

func (g *GitLocal) DiscoverRemoteGitURL(gitConf string) (string, error)

DiscoverRemoteGitURL discovers the remote git URL from the given git configuration

func (*GitLocal) DiscoverUpstreamGitURL Uses

func (g *GitLocal) DiscoverUpstreamGitURL(gitConf string) (string, error)

DiscoverUpstreamGitURL discovers the upstream git URL from the given git configuration

func (*GitLocal) Email Uses

func (g *GitLocal) Email(dir string) (string, error)

Email returns the email from the git configuration Faked out

func (*GitLocal) FetchBranch Uses

func (g *GitLocal) FetchBranch(dir string, repo string, refspec ...string) error

FetchBranch fetches a branch Faked out

func (*GitLocal) FetchBranchShallow Uses

func (g *GitLocal) FetchBranchShallow(dir string, repo string, refspec ...string) error

FetchBranchShallow fetches a branch Faked out

func (*GitLocal) FetchBranchUnshallow Uses

func (g *GitLocal) FetchBranchUnshallow(dir string, repo string, refspec ...string) error

FetchBranchUnshallow fetches a branch Faked out

func (*GitLocal) FetchTags Uses

func (g *GitLocal) FetchTags(dir string) error

FetchTags fetches all the tags Faked out

func (*GitLocal) FetchUnshallow Uses

func (g *GitLocal) FetchUnshallow(dir string) error

FetchUnshallow does nothing Faked out

func (*GitLocal) FilterTags Uses

func (g *GitLocal) FilterTags(dir string, filter string) ([]string, error)

FilterTags returns all tags from the repository at the given directory that match the filter

func (*GitLocal) FindGitConfigDir Uses

func (g *GitLocal) FindGitConfigDir(dir string) (string, string, error)

FindGitConfigDir tries to find the `.git` directory either in the current directory or in parent directories Faked out

func (*GitLocal) ForcePushBranch Uses

func (g *GitLocal) ForcePushBranch(dir string, localBranch string, remoteBranch string) error

ForcePushBranch does a force push of the local branch into the remote branch of the repository at the given directory Faked out

func (*GitLocal) GetAuthorEmailForCommit Uses

func (g *GitLocal) GetAuthorEmailForCommit(dir string, sha string) (string, error)

GetAuthorEmailForCommit returns the author email from commit message with the given SHA

func (*GitLocal) GetCommitPointedToByLatestTag Uses

func (g *GitLocal) GetCommitPointedToByLatestTag(dir string) (string, string, error)

GetCommitPointedToByLatestTag return the SHA of the current git tag from the repository at the given directory

func (*GitLocal) GetCommitPointedToByPreviousTag Uses

func (g *GitLocal) GetCommitPointedToByPreviousTag(dir string) (string, string, error)

GetCommitPointedToByPreviousTag returns the previous git tag from the repository at the given directory

func (*GitLocal) GetCommits Uses

func (g *GitLocal) GetCommits(dir string, startSha string, endSha string) ([]GitCommit, error)

GetCommits returns the commits in a range, exclusive of startSha and inclusive of endSha

func (*GitLocal) GetCommitsNotOnAnyRemote Uses

func (g *GitLocal) GetCommitsNotOnAnyRemote(dir string, branch string) ([]GitCommit, error)

GetCommitsNotOnAnyRemote returns a list of commits which are on branch but not present on a remote

func (*GitLocal) GetLatestCommitMessage Uses

func (g *GitLocal) GetLatestCommitMessage(dir string) (string, error)

GetLatestCommitMessage returns the latest git commit message

func (*GitLocal) GetLatestCommitSha Uses

func (g *GitLocal) GetLatestCommitSha(dir string) (string, error)

GetLatestCommitSha returns the sha of the last commit

func (*GitLocal) GetRemoteUrl Uses

func (g *GitLocal) GetRemoteUrl(config *gitcfg.Config, name string) string

GetRemoteUrl returns the remote URL from the given git config

func (*GitLocal) GetRevisionBeforeDate Uses

func (g *GitLocal) GetRevisionBeforeDate(dir string, t time.Time) (string, error)

GetRevisionBeforeDate returns the revision before the given date

func (*GitLocal) GetRevisionBeforeDateText Uses

func (g *GitLocal) GetRevisionBeforeDateText(dir string, dateText string) (string, error)

GetRevisionBeforeDateText returns the revision before the given date in format "MonthName dayNumber year"

func (*GitLocal) HasChanges Uses

func (g *GitLocal) HasChanges(dir string) (bool, error)

HasChanges indicates if there are any changes in the repository from the given directory

func (*GitLocal) Info Uses

func (g *GitLocal) Info(dir string) (*GitRepository, error)

Info returns the git info of the repository at the given directory

func (*GitLocal) Init Uses

func (g *GitLocal) Init(dir string) error

Init inits a git repository into the given directory

func (*GitLocal) IsFork Uses

func (g *GitLocal) IsFork(dir string) (bool, error)

IsFork indicates if the repository at the given directory is a fork

func (*GitLocal) IsShallow Uses

func (g *GitLocal) IsShallow(dir string) (bool, error)

IsShallow runs git rev-parse --is-shalllow-repository in dir

func (*GitLocal) ListChangedFilesFromBranch Uses

func (g *GitLocal) ListChangedFilesFromBranch(dir string, branch string) (string, error)

ListChangedFilesFromBranch lists files changed between branches

func (*GitLocal) LoadFileFromBranch Uses

func (g *GitLocal) LoadFileFromBranch(dir string, branch string, file string) (string, error)

LoadFileFromBranch returns a files's contents from a branch

func (*GitLocal) LocalBranches Uses

func (g *GitLocal) LocalBranches(dir string) ([]string, error)

LocalBranches will list all local branches

func (*GitLocal) Merge Uses

func (g *GitLocal) Merge(dir string, commitish string) error

Merge merges the commitish into the current branch

func (*GitLocal) MergeTheirs Uses

func (g *GitLocal) MergeTheirs(dir string, commitish string) error

MergeTheirs performs a cherry pick of commitish

func (*GitLocal) PrintCreateRepositoryGenerateAccessToken Uses

func (g *GitLocal) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)

PrintCreateRepositoryGenerateAccessToken prints the access token URL of a Git repository

func (*GitLocal) Pull Uses

func (g *GitLocal) Pull(dir string) error

Pull pulls the Git repository in the given directory Faked out

func (*GitLocal) PullRemoteBranches Uses

func (g *GitLocal) PullRemoteBranches(dir string) error

PullRemoteBranches pulls the remote Git tags from the given given directory Faked out

func (*GitLocal) PullUpstream Uses

func (g *GitLocal) PullUpstream(dir string) error

PullUpstream pulls the remote upstream branch into master branch into the given directory Faked out

func (*GitLocal) Push Uses

func (g *GitLocal) Push(dir string, remote string, force bool, setUpstream bool, refspec ...string) error

Push pushes the changes from the repository at the given directory Faked out

func (*GitLocal) PushMaster Uses

func (g *GitLocal) PushMaster(dir string) error

PushMaster pushes the master branch into the origin Faked out

func (*GitLocal) PushMirror Uses

func (g *GitLocal) PushMirror(dir string, url string) error

PushMirror does nothing

func (*GitLocal) PushTag Uses

func (g *GitLocal) PushTag(dir string, tag string) error

PushTag pushes the given tag into the origin Faked out

func (*GitLocal) RebaseTheirs Uses

func (g *GitLocal) RebaseTheirs(dir string, upstream string, branch string, skipEmpty bool) error

RebaseTheirs runs git rebase upstream branch

func (*GitLocal) RemoteBranchNames Uses

func (g *GitLocal) RemoteBranchNames(dir string, prefix string) ([]string, error)

RemoteBranchNames returns all remote branch names with the given prefix

func (*GitLocal) RemoteBranches Uses

func (g *GitLocal) RemoteBranches(dir string) ([]string, error)

RemoteBranches returns the remote branches

func (*GitLocal) RemoteUpdate Uses

func (g *GitLocal) RemoteUpdate(dir string) error

RemoteUpdate performs a git remote update Faked out

func (*GitLocal) Remotes Uses

func (g *GitLocal) Remotes(dir string) ([]string, error)

Remotes will list the names of the remotes

func (*GitLocal) Remove Uses

func (g *GitLocal) Remove(dir, fileName string) error

Remove removes the given file from a Git repository located at the given directory

func (*GitLocal) RemoveForce Uses

func (g *GitLocal) RemoveForce(dir, fileName string) error

RemoveForce removes the given file from a git repository located at the given directory

func (*GitLocal) RepoName Uses

func (g *GitLocal) RepoName(org, repoName string) string

RepoName formats the repository names based on the organization

func (*GitLocal) Reset Uses

func (g *GitLocal) Reset(dir string, commitish string, hard bool) error

Reset performs a git reset --hard back to the commitish specified

func (*GitLocal) ResetToUpstream Uses

func (g *GitLocal) ResetToUpstream(dir string, branch string) error

ResetToUpstream resets the given branch to the upstream version

func (*GitLocal) RevParse Uses

func (g *GitLocal) RevParse(dir string, rev string) (string, error)

RevParse runs git rev parse

func (*GitLocal) Server Uses

func (g *GitLocal) Server(dir string) (string, error)

Server returns the Git server of the repository at the given directory

func (*GitLocal) SetEmail Uses

func (g *GitLocal) SetEmail(dir string, email string) error

SetEmail sets the given email in the git configuration Faked out

func (*GitLocal) SetRemoteURL Uses

func (g *GitLocal) SetRemoteURL(dir string, name string, gitURL string) error

SetRemoteURL sets the remote URL of the remote with the given name

func (*GitLocal) SetUpstreamTo Uses

func (g *GitLocal) SetUpstreamTo(dir string, branch string) error

SetUpstreamTo will set the given branch to track the origin branch with the same name

func (*GitLocal) SetUsername Uses

func (g *GitLocal) SetUsername(dir string, username string) error

SetUsername sets the username in the git configuration Faked out

func (*GitLocal) ShallowClone Uses

func (g *GitLocal) ShallowClone(dir string, url string, commitish string, pullRequest string) error

ShallowClone shallow clones the repo at url from the specified commitish or pull request to a local master branch Faked out

func (*GitLocal) ShallowCloneBranch Uses

func (g *GitLocal) ShallowCloneBranch(url string, branch string, dir string) error

ShallowCloneBranch clones a single branch of the given git URL into the given directory Faked out

func (*GitLocal) StashPop Uses

func (g *GitLocal) StashPop(dir string) error

StashPop runs git stash pop

func (*GitLocal) StashPush Uses

func (g *GitLocal) StashPush(dir string) error

StashPush stashes the current changes from the given directory

func (*GitLocal) Status Uses

func (g *GitLocal) Status(dir string) error

Status returns the status of the git repository at the given directory

func (*GitLocal) Tags Uses

func (g *GitLocal) Tags(dir string) ([]string, error)

Tags returns all tags from the repository at the given directory

func (*GitLocal) UpdateRemote Uses

func (g *GitLocal) UpdateRemote(dir, url string) error

UpdateRemote updates the URL of the remote repository

func (*GitLocal) Username Uses

func (g *GitLocal) Username(dir string) (string, error)

Username return the username from the git configuration Faked out

func (*GitLocal) Version Uses

func (g *GitLocal) Version() (string, error)

Version returns the git version

type GitOrganisation Uses

type GitOrganisation struct {
    Login string
}

type GitProject Uses

type GitProject struct {
    Name        string
    Description string
    Number      int
    State       string
}

GitProject is a project for managing issues

type GitProvider Uses

type GitProvider interface {
    OrganisationLister

    ListRepositories(org string) ([]*GitRepository, error)

    CreateRepository(org string, name string, private bool) (*GitRepository, error)

    GetRepository(org string, name string) (*GitRepository, error)

    DeleteRepository(org string, name string) error

    ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)

    RenameRepository(org string, name string, newName string) (*GitRepository, error)

    ValidateRepositoryName(org string, name string) error

    CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)

    UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

    UpdatePullRequestStatus(pr *GitPullRequest) error

    AddLabelsToIssue(owner, repo string, number int, labels []string) error

    GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)

    ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

    GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error)

    PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

    ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

    ListCommits(owner string, repo string, opt *ListCommitsArguments) ([]*GitCommit, error)

    UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

    MergePullRequest(pr *GitPullRequest, message string) error

    CreateWebHook(data *GitWebHookArguments) error

    ListWebHooks(org string, repo string) ([]*GitWebHookArguments, error)

    UpdateWebHook(data *GitWebHookArguments) error

    IsGitHub() bool

    IsGitea() bool

    IsBitbucketCloud() bool

    IsBitbucketServer() bool

    IsGerrit() bool

    Kind() string

    GetIssue(org string, name string, number int) (*GitIssue, error)

    IssueURL(org string, name string, number int, isPull bool) string

    SearchIssues(org string, name string, state string) ([]*GitIssue, error)

    SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)

    CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

    HasIssues() bool

    AddPRComment(pr *GitPullRequest, comment string) error

    CreateIssueComment(owner string, repo string, number int, comment string) error

    UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

    UpdateReleaseStatus(owner string, repo string, tag string, releaseInfo *GitRelease) error

    ListReleases(org string, name string) ([]*GitRelease, error)

    GetRelease(org string, name string, tag string) (*GitRelease, error)

    UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

    GetLatestRelease(org string, name string) (*GitRelease, error)

    GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

    JenkinsWebHookPath(gitURL string, secret string) string

    // Label returns the Git service label or name
    Label() string

    // ServerURL returns the Git server URL
    ServerURL() string

    // BranchArchiveURL returns a URL to the ZIP archive for the git branch
    BranchArchiveURL(org string, name string, branch string) string

    // Returns the current username
    CurrentUsername() string

    // Returns the current user auth
    UserAuth() auth.UserAuth

    // Returns user info, if possible
    UserInfo(username string) *GitUser

    AddCollaborator(string, string, string) error
    // TODO Refactor to remove bespoke types when we implement another provider
    ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
    // TODO Refactor to remove bespoke types when we implement another provider
    AcceptInvitation(int64) (*github.Response, error)

    // ShouldForkForPullRequest returns true if we should create a personal fork of this repository
    // before creating a pull request
    ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

    GetBranch(owner string, repo string, branch string) (*GitBranch, error)

    GetProjects(owner string, repo string) ([]GitProject, error)

    IsWikiEnabled(owner string, repo string) (bool, error)

    ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)
}

GitProvider is the interface for abstracting use of different git provider APIs go:generate pegomock generate github.com/jenkins-x/jx/pkg/gits GitProvider -o mocks/git_provider.go

func CreateProvider Uses

func CreateProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)

func CreateProviderForURL Uses

func CreateProviderForURL(inCluster bool, authConfigSvc auth.ConfigService, gitKind string, hostUrl string, git Gitter, batchMode bool,
    in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (GitProvider, error)

CreateProviderForURL creates the Git provider for the given git kind and host URL

func NewBitbucketCloudProvider Uses

func NewBitbucketCloudProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)

func NewBitbucketServerProvider Uses

func NewBitbucketServerProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)

func NewGerritProvider Uses

func NewGerritProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)

func NewGitHubProvider Uses

func NewGitHubProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)

func NewGiteaProvider Uses

func NewGiteaProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)

func NewGitlabProvider Uses

func NewGitlabProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)

func WithGitlabClient Uses

func WithGitlabClient(server *auth.AuthServer, user *auth.UserAuth, client *gitlab.Client, git Gitter) (GitProvider, error)

Used by unit tests to inject a mocked client

type GitPullRequest Uses

type GitPullRequest struct {
    URL                string
    Author             *GitUser
    Owner              string
    Repo               string
    Number             *int
    Mergeable          *bool
    Merged             *bool
    HeadRef            *string
    State              *string
    StatusesURL        *string
    IssueURL           *string
    DiffURL            *string
    MergeCommitSHA     *string
    ClosedAt           *time.Time
    MergedAt           *time.Time
    LastCommitSha      string
    Title              string
    Body               string
    Assignees          []*GitUser
    RequestedReviewers []*GitUser
    Labels             []*Label
    UpdatedAt          *time.Time
    HeadOwner          *string // HeadOwner is the string the PR is created from
}

func FilterOpenPullRequests Uses

func FilterOpenPullRequests(provider GitProvider, owner string, repo string, filter PullRequestFilter) ([]*GitPullRequest, error)

FilterOpenPullRequests looks for any pull requests on the owner/repo where all the labels match

func (*GitPullRequest) IsClosed Uses

func (pr *GitPullRequest) IsClosed() bool

IsClosed returns true if the PullRequest has been closed

func (*GitPullRequest) NumberString Uses

func (pr *GitPullRequest) NumberString() string

NumberString returns the string representation of the Pull Request number or blank if its missing

type GitPullRequestArguments Uses

type GitPullRequestArguments struct {
    Title         string
    Body          string
    Head          string
    Base          string
    GitRepository *GitRepository
    Labels        []string
}

func (*GitPullRequestArguments) String Uses

func (a *GitPullRequestArguments) String() string

type GitRelease Uses

type GitRelease struct {
    ID            int64
    Name          string
    TagName       string
    Body          string
    PreRelease    bool
    URL           string
    HTMLURL       string
    DownloadCount int
    Assets        *[]GitReleaseAsset
}

type GitReleaseAsset Uses

type GitReleaseAsset struct {
    ID                 int64
    BrowserDownloadURL string
    Name               string
    ContentType        string
}

GitReleaseAsset represents a release stored in Git

type GitRemote Uses

type GitRemote struct {
    Name string
    URL  string
}

GitRemote a remote url

type GitRepoStatus Uses

type GitRepoStatus struct {
    ID      string
    Context string
    URL     string

    // State is the current state of the repository. Possible values are:
    // pending, success, error, or failure.
    State string `json:"state,omitempty"`

    // TargetURL is the URL of the page representing this status
    TargetURL string `json:"target_url,omitempty"`

    // Description is a short high level summary of the status.
    Description string
}

func (*GitRepoStatus) IsFailed Uses

func (s *GitRepoStatus) IsFailed() bool

func (*GitRepoStatus) IsSuccess Uses

func (s *GitRepoStatus) IsSuccess() bool

type GitRepository Uses

type GitRepository struct {
    Name             string
    AllowMergeCommit bool
    HTMLURL          string
    CloneURL         string
    SSHURL           string
    Language         string
    Fork             bool
    Stars            int
    URL              string
    Scheme           string
    Host             string
    Organisation     string
    Project          string
    Private          bool
    HasIssues        bool
    OpenIssueCount   int
    HasWiki          bool
    HasProjects      bool
    Archived         bool
}

func BitbucketRepositoryToGitRepository Uses

func BitbucketRepositoryToGitRepository(bRepo bitbucket.Repository) *GitRepository

func BitbucketServerRepositoryToGitRepository Uses

func BitbucketServerRepositoryToGitRepository(bRepo bitbucket.Repository) *GitRepository

func DuplicateGitRepoFromCommitish Uses

func DuplicateGitRepoFromCommitish(toOrg string, toName string, fromGitURL string, fromCommitish string, toBranch string, private bool, provider GitProvider, gitter Gitter) (*GitRepository, error)

DuplicateGitRepoFromCommitish will duplicate branches (but not tags) from fromGitURL to toOrg/toName. It will reset the head of the toBranch on the duplicated repo to fromCommitish. It returns the GitRepository for the duplicated repo

func ParseGitOrganizationURL Uses

func ParseGitOrganizationURL(text string) (*GitRepository, error)

ParseGitOrganizationURL attempts to parse the given text as a URL or git URL-like string to determine the protocol, host, organisation

func ParseGitURL Uses

func ParseGitURL(text string) (*GitRepository, error)

ParseGitURL attempts to parse the given text as a URL or git URL-like string to determine the protocol, host, organisation and name

func PickRepositories Uses

func PickRepositories(provider GitProvider, owner string, message string, selectAll bool, filter string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) ([]*GitRepository, error)

func (*GitRepository) CreateProvider Uses

func (i *GitRepository) CreateProvider(inCluster bool, authConfigSvc auth.ConfigService, gitKind string, git Gitter, batchMode bool, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (GitProvider, error)

func (*GitRepository) CreateProviderForUser Uses

func (i *GitRepository) CreateProviderForUser(server *auth.AuthServer, user *auth.UserAuth, gitKind string, git Gitter) (GitProvider, error)

func (*GitRepository) HostURL Uses

func (i *GitRepository) HostURL() string

HostURL returns the URL to the host

func (*GitRepository) HostURLWithoutUser Uses

func (i *GitRepository) HostURLWithoutUser() string

func (*GitRepository) HttpCloneURL Uses

func (i *GitRepository) HttpCloneURL() string

HttpCloneURL returns the HTTPS git URL this repository

func (*GitRepository) HttpURL Uses

func (i *GitRepository) HttpURL() string

HttpURL returns the URL to browse this repository in a web browser

func (*GitRepository) HttpsURL Uses

func (i *GitRepository) HttpsURL() string

HttpsURL returns the URL to browse this repository in a web browser

func (*GitRepository) IsGitHub Uses

func (i *GitRepository) IsGitHub() bool

func (*GitRepository) PickOrCreateProvider Uses

func (i *GitRepository) PickOrCreateProvider(authConfigSvc auth.ConfigService, message string, batchMode bool, gitKind string, git Gitter, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (GitProvider, error)

func (*GitRepository) PipelinePath Uses

func (i *GitRepository) PipelinePath() string

PipelinePath returns the pipeline path for the master branch which can be used to query pipeline logs in `jx get build logs myPipelinePath`

func (*GitRepository) ProviderURL Uses

func (i *GitRepository) ProviderURL() string

ProviderURL returns the git provider URL

func (*GitRepository) PullRequestURL Uses

func (i *GitRepository) PullRequestURL(prName string) string

PullRequestURL returns the URL of a pull request of the given name/number

func (*GitRepository) URLWithoutUser Uses

func (i *GitRepository) URLWithoutUser() string

URLWithoutUser returns the URL without any user/password

type GitRepositoryOptions Uses

type GitRepositoryOptions struct {
    ServerURL                string
    ServerKind               string
    Username                 string
    ApiToken                 string
    Owner                    string
    RepoName                 string
    Public                   bool
    IgnoreExistingRepository bool
}

type GitTag Uses

type GitTag struct {
    Name    string
    Message string
}

GitTag git tag

type GitUser Uses

type GitUser struct {
    URL       string
    Login     string
    Name      string
    Email     string
    AvatarURL string
}

type GitWebHookArguments Uses

type GitWebHookArguments struct {
    ID          int64
    Owner       string
    Repo        *GitRepository
    URL         string
    ExistingURL string
    Secret      string
}

type GiteaProvider Uses

type GiteaProvider struct {
    Username string
    Client   *gitea.Client

    Server auth.AuthServer
    User   auth.UserAuth
    Git    Gitter
}

func (*GiteaProvider) AcceptInvitation Uses

func (p *GiteaProvider) AcceptInvitation(ID int64) (*github.Response, error)

func (*GiteaProvider) AddCollaborator Uses

func (p *GiteaProvider) AddCollaborator(user string, organisation string, repo string) error

func (*GiteaProvider) AddLabelsToIssue Uses

func (p *GiteaProvider) AddLabelsToIssue(owner, repo string, number int, labels []string) error

AddLabelsToIssue adds labels to issues or pullrequests

func (*GiteaProvider) AddPRComment Uses

func (p *GiteaProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*GiteaProvider) BranchArchiveURL Uses

func (p *GiteaProvider) BranchArchiveURL(org string, name string, branch string) string

func (*GiteaProvider) ConfigureFeatures Uses

func (p *GiteaProvider) ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)

ConfigureFeatures sets specific features as enabled or disabled for owner/repo

func (*GiteaProvider) CreateIssue Uses

func (p *GiteaProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*GiteaProvider) CreateIssueComment Uses

func (p *GiteaProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

func (*GiteaProvider) CreatePullRequest Uses

func (p *GiteaProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)

func (*GiteaProvider) CreateRepository Uses

func (p *GiteaProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)

func (*GiteaProvider) CreateWebHook Uses

func (p *GiteaProvider) CreateWebHook(data *GitWebHookArguments) error

func (*GiteaProvider) CurrentUsername Uses

func (p *GiteaProvider) CurrentUsername() string

func (*GiteaProvider) DeleteRepository Uses

func (p *GiteaProvider) DeleteRepository(org string, name string) error

func (*GiteaProvider) ForkRepository Uses

func (p *GiteaProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)

func (*GiteaProvider) GetBranch Uses

func (p *GiteaProvider) GetBranch(owner string, repo string, branch string) (*GitBranch, error)

GetBranch returns the branch information for an owner/repo, including the commit at the tip

func (*GiteaProvider) GetContent Uses

func (p *GiteaProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

func (*GiteaProvider) GetIssue Uses

func (p *GiteaProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*GiteaProvider) GetLatestRelease Uses

func (p *GiteaProvider) GetLatestRelease(org string, name string) (*GitRelease, error)

GetLatestRelease fetches the latest release from the git provider for org and name

func (*GiteaProvider) GetProjects Uses

func (p *GiteaProvider) GetProjects(owner string, repo string) ([]GitProject, error)

GetProjects returns all the git projects in owner/repo

func (*GiteaProvider) GetPullRequest Uses

func (p *GiteaProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)

func (*GiteaProvider) GetPullRequestCommits Uses

func (p *GiteaProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)

func (*GiteaProvider) GetRelease Uses

func (p *GiteaProvider) GetRelease(org string, name string, tag string) (*GitRelease, error)

GetRelease returns the release info for org, repo name and tag

func (*GiteaProvider) GetRepository Uses

func (p *GiteaProvider) GetRepository(org string, name string) (*GitRepository, error)

func (*GiteaProvider) HasIssues Uses

func (p *GiteaProvider) HasIssues() bool

func (*GiteaProvider) IsBitbucketCloud Uses

func (p *GiteaProvider) IsBitbucketCloud() bool

func (*GiteaProvider) IsBitbucketServer Uses

func (p *GiteaProvider) IsBitbucketServer() bool

func (*GiteaProvider) IsGerrit Uses

func (p *GiteaProvider) IsGerrit() bool

func (*GiteaProvider) IsGitHub Uses

func (p *GiteaProvider) IsGitHub() bool

func (*GiteaProvider) IsGitea Uses

func (p *GiteaProvider) IsGitea() bool

func (*GiteaProvider) IsWikiEnabled Uses

func (p *GiteaProvider) IsWikiEnabled(owner string, repo string) (bool, error)

IsWikiEnabled returns true if a wiki is enabled for owner/repo

func (*GiteaProvider) IssueURL Uses

func (p *GiteaProvider) IssueURL(org string, name string, number int, isPull bool) string

func (*GiteaProvider) JenkinsWebHookPath Uses

func (p *GiteaProvider) JenkinsWebHookPath(gitURL string, secret string) string

func (*GiteaProvider) Kind Uses

func (p *GiteaProvider) Kind() string

func (*GiteaProvider) Label Uses

func (p *GiteaProvider) Label() string

func (*GiteaProvider) ListCommitStatus Uses

func (p *GiteaProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

func (*GiteaProvider) ListCommits Uses

func (p *GiteaProvider) ListCommits(owner, repo string, opt *ListCommitsArguments) ([]*GitCommit, error)

func (*GiteaProvider) ListInvitations Uses

func (p *GiteaProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)

func (*GiteaProvider) ListOpenPullRequests Uses

func (p *GiteaProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

ListOpenPullRequests lists the open pull requests

func (*GiteaProvider) ListOrganisations Uses

func (p *GiteaProvider) ListOrganisations() ([]GitOrganisation, error)

func (*GiteaProvider) ListReleases Uses

func (p *GiteaProvider) ListReleases(org string, name string) ([]*GitRelease, error)

func (*GiteaProvider) ListRepositories Uses

func (p *GiteaProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*GiteaProvider) ListWebHooks Uses

func (p *GiteaProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)

func (*GiteaProvider) MergePullRequest Uses

func (p *GiteaProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*GiteaProvider) PullRequestLastCommitStatus Uses

func (p *GiteaProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*GiteaProvider) RenameRepository Uses

func (p *GiteaProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)

func (*GiteaProvider) SearchIssues Uses

func (p *GiteaProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, error)

func (*GiteaProvider) SearchIssuesClosedSince Uses

func (p *GiteaProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)

func (*GiteaProvider) ServerURL Uses

func (p *GiteaProvider) ServerURL() string

func (*GiteaProvider) ShouldForkForPullRequest Uses

func (p *GiteaProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request

func (*GiteaProvider) UpdateCommitStatus Uses

func (b *GiteaProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

func (*GiteaProvider) UpdatePullRequest Uses

func (p *GiteaProvider) UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

UpdatePullRequest updates pull request with number using data

func (*GiteaProvider) UpdatePullRequestStatus Uses

func (p *GiteaProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*GiteaProvider) UpdateRelease Uses

func (p *GiteaProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

func (*GiteaProvider) UpdateReleaseStatus Uses

func (p *GiteaProvider) UpdateReleaseStatus(owner string, repo string, tag string, releaseInfo *GitRelease) error

UpdateReleaseStatus updates the state (release/prerelease) of a release

func (*GiteaProvider) UpdateWebHook Uses

func (p *GiteaProvider) UpdateWebHook(data *GitWebHookArguments) error

func (*GiteaProvider) UploadReleaseAsset Uses

func (p *GiteaProvider) UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

UploadReleaseAsset will upload an asset to org/repo to a release with id, giving it a name, it will return the release asset from the git provider

func (*GiteaProvider) UserAuth Uses

func (p *GiteaProvider) UserAuth() auth.UserAuth

func (*GiteaProvider) UserInfo Uses

func (p *GiteaProvider) UserInfo(username string) *GitUser

func (*GiteaProvider) ValidateRepositoryName Uses

func (p *GiteaProvider) ValidateRepositoryName(org string, name string) error

type GitlabProvider Uses

type GitlabProvider struct {
    Username string
    Client   *gitlab.Client
    Context  context.Context

    Server auth.AuthServer
    User   auth.UserAuth
    Git    Gitter
}

func (*GitlabProvider) AcceptInvitation Uses

func (g *GitlabProvider) AcceptInvitation(ID int64) (*github.Response, error)

AcceptInvitation accepts an invitation

func (*GitlabProvider) AddCollaborator Uses

func (g *GitlabProvider) AddCollaborator(user string, organisation string, repo string) error

AddCollaborator adds a collaborator

func (*GitlabProvider) AddLabelsToIssue Uses

func (g *GitlabProvider) AddLabelsToIssue(owner, repo string, number int, labels []string) error

AddLabelsToIssue adds labels to issues or pullrequests

func (*GitlabProvider) AddPRComment Uses

func (g *GitlabProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*GitlabProvider) BranchArchiveURL Uses

func (g *GitlabProvider) BranchArchiveURL(org string, name string, branch string) string

func (*GitlabProvider) ConfigureFeatures Uses

func (g *GitlabProvider) ConfigureFeatures(owner string, repo string, issues *bool, projects *bool, wikis *bool) (*GitRepository, error)

ConfigureFeatures sets specific features as enabled or disabled for owner/repo

func (*GitlabProvider) CreateIssue Uses

func (g *GitlabProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*GitlabProvider) CreateIssueComment Uses

func (g *GitlabProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

func (*GitlabProvider) CreatePullRequest Uses

func (g *GitlabProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)

func (*GitlabProvider) CreateRepository Uses

func (g *GitlabProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)

func (*GitlabProvider) CreateWebHook Uses

func (g *GitlabProvider) CreateWebHook(data *GitWebHookArguments) error

func (*GitlabProvider) CurrentUsername Uses

func (g *GitlabProvider) CurrentUsername() string

func (*GitlabProvider) DeleteRepository Uses

func (g *GitlabProvider) DeleteRepository(org, name string) error

func (*GitlabProvider) ForkRepository Uses

func (g *GitlabProvider) ForkRepository(originalOrg, name, destinationOrg string) (*GitRepository, error)

func (*GitlabProvider) GetBranch Uses

func (g *GitlabProvider) GetBranch(owner string, repo string, branch string) (*GitBranch, error)

GetBranch returns the branch information for an owner/repo, including the commit at the tip

func (*GitlabProvider) GetContent Uses

func (g *GitlabProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)

GetContent returns the content of a file

func (*GitlabProvider) GetIssue Uses

func (g *GitlabProvider) GetIssue(org, repo string, number int) (*GitIssue, error)

func (*GitlabProvider) GetLatestRelease Uses

func (g *GitlabProvider) GetLatestRelease(org string, name string) (*GitRelease, error)

GetLatestRelease fetches the latest release from the git provider for org and name

func (*GitlabProvider) GetProjects Uses

func (g *GitlabProvider) GetProjects(owner string, repo string) ([]GitProject, error)

GetProjects returns all the git projects in owner/repo

func (*GitlabProvider) GetPullRequest Uses

func (g *GitlabProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)

GetPullRequest gets a PR

func (*GitlabProvider) GetPullRequestCommits Uses

func (g *GitlabProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)

GetPullRequestCommits gets the PR commits

func (*GitlabProvider) GetRelease Uses

func (g *GitlabProvider) GetRelease(org string, name string, tag string) (*GitRelease, error)

GetRelease returns the release info for the org, repo name and tag

func (*GitlabProvider) GetRepository Uses

func (g *GitlabProvider) GetRepository(org, name string) (*GitRepository, error)

func (*GitlabProvider) HasIssues Uses

func (g *GitlabProvider) HasIssues() bool

func (*GitlabProvider) IsBitbucketCloud Uses

func (g *GitlabProvider) IsBitbucketCloud() bool

func (*GitlabProvider) IsBitbucketServer Uses

func (g *GitlabProvider) IsBitbucketServer() bool

func (*GitlabProvider) IsGerrit Uses

func (g *GitlabProvider) IsGerrit() bool

func (*GitlabProvider) IsGitHub Uses

func (g *GitlabProvider) IsGitHub() bool

func (*GitlabProvider) IsGitea Uses

func (g *GitlabProvider) IsGitea() bool

func (*GitlabProvider) IsWikiEnabled Uses

func (g *GitlabProvider) IsWikiEnabled(owner string, repo string) (bool, error)

IsWikiEnabled returns true if a wiki is enabled for owner/repo

func (*GitlabProvider) IssueURL Uses

func (g *GitlabProvider) IssueURL(org string, name string, number int, isPull bool) string

IssueURL returns the URL of the issue

func (*GitlabProvider) JenkinsWebHookPath Uses

func (g *GitlabProvider) JenkinsWebHookPath(gitURL string, secret string) string

func (*GitlabProvider) Kind Uses

func (g *GitlabProvider) Kind() string

func (*GitlabProvider) Label Uses

func (g *GitlabProvider) Label() string

func (*GitlabProvider) ListCommitStatus Uses

func (g *GitlabProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

func (*GitlabProvider) ListCommits Uses

func (g *GitlabProvider) ListCommits(owner, repo string, opt *ListCommitsArguments) ([]*GitCommit, error)

ListCommits lists the commits for the specified repo and owner

func (*GitlabProvider) ListInvitations Uses

func (g *GitlabProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)

ListInvitations lists pending invites

func (*GitlabProvider) ListOpenPullRequests Uses

func (g *GitlabProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)

ListOpenPullRequests lists the open pull requests

func (*GitlabProvider) ListOrganisations Uses

func (g *GitlabProvider) ListOrganisations() ([]GitOrganisation, error)

func (*GitlabProvider) ListReleases Uses

func (g *GitlabProvider) ListReleases(org string, name string) ([]*GitRelease, error)

func (*GitlabProvider) ListRepositories Uses

func (g *GitlabProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*GitlabProvider) ListWebHooks Uses

func (g *GitlabProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)

ListWebHooks lists the webhooks

func (*GitlabProvider) MergePullRequest Uses

func (g *GitlabProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*GitlabProvider) PullRequestLastCommitStatus Uses

func (g *GitlabProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*GitlabProvider) RenameRepository Uses

func (g *GitlabProvider) RenameRepository(org, name, newName string) (*GitRepository, error)

func (*GitlabProvider) SearchIssues Uses

func (g *GitlabProvider) SearchIssues(org, repo, query string) ([]*GitIssue, error)

func (*GitlabProvider) SearchIssuesClosedSince Uses

func (g *GitlabProvider) SearchIssuesClosedSince(org string, repo string, t time.Time) ([]*GitIssue, error)

func (*GitlabProvider) ServerURL Uses

func (g *GitlabProvider) ServerURL() string

func (*GitlabProvider) ShouldForkForPullRequest Uses

func (g *GitlabProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool

ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request

func (*GitlabProvider) UpdateCommitStatus Uses

func (g *GitlabProvider) UpdateCommitStatus(owner string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)

UpdateCommitStatus updates the commit status

func (*GitlabProvider) UpdatePullRequest Uses

func (g *GitlabProvider) UpdatePullRequest(data *GitPullRequestArguments, number int) (*GitPullRequest, error)

UpdatePullRequest updates pull request with number using data

func (*GitlabProvider) UpdatePullRequestStatus Uses

func (g *GitlabProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*GitlabProvider) UpdateRelease Uses

func (g *GitlabProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

func (*GitlabProvider) UpdateReleaseStatus Uses

func (g *GitlabProvider) UpdateReleaseStatus(owner string, repo string, tag string, releaseInfo *GitRelease) error

UpdateReleaseStatus is not supported for this git provider

func (*GitlabProvider) UpdateWebHook Uses

func (g *GitlabProvider) UpdateWebHook(data *GitWebHookArguments) error

func (*GitlabProvider) UploadReleaseAsset Uses

func (g *GitlabProvider) UploadReleaseAsset(org string, repo string, id int64, name string, asset *os.File) (*GitReleaseAsset, error)

UploadReleaseAsset will upload an asset to org/repo to a release with id, giving it a name, it will return the release asset from the git provider

func (*GitlabProvider) UserAuth Uses

func (g *GitlabProvider) UserAuth() auth.UserAuth

func (*GitlabProvider) UserInfo Uses

func (g *GitlabProvider) UserInfo(username string) *GitUser

func (*GitlabProvider) ValidateRepositoryName Uses

func (g *GitlabProvider) ValidateRepositoryName(org, name string) error

type Gitter Uses

type Gitter interface {
    FindGitConfigDir(dir string) (string, string, error)
    PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)

    Status(dir string) error
    Server(dir string) (string, error)
    Info(dir string) (*GitRepository, error)
    IsFork(dir string) (bool, error)
    Version() (string, error)
    RepoName(org, repoName string) string

    Username(dir string) (string, error)
    SetUsername(dir string, username string) error
    Email(dir string) (string, error)
    SetEmail(dir string, email string) error
    GetAuthorEmailForCommit(dir string, sha string) (string, error)

    Init(dir string) error
    Clone(url string, directory string) error
    CloneBare(dir string, url string) error
    PushMirror(dir string, url string) error

    // ShallowCloneBranch TODO not sure if this method works any more - consider using ShallowClone(dir, url, branch, "")
    ShallowCloneBranch(url string, branch string, directory string) error
    ShallowClone(dir string, url string, commitish string, pullRequest string) error
    FetchUnshallow(dir string) error
    IsShallow(dir string) (bool, error)
    Push(dir string, remote string, force bool, setUpstream bool, refspec ...string) error
    PushMaster(dir string) error
    PushTag(dir string, tag string) error
    // CreateAuthenticatedURL adds username and password into the specified git URL.
    CreateAuthenticatedURL(url string, userAuth *auth.UserAuth) (string, error)
    ForcePushBranch(dir string, localBranch string, remoteBranch string) error
    CloneOrPull(url string, directory string) error
    Pull(dir string) error
    PullRemoteBranches(dir string) error
    PullUpstream(dir string) error

    // ResetToUpstream resets the given branch to the upstream version
    ResetToUpstream(dir string, branch string) error

    AddRemote(dir string, name string, url string) error
    SetRemoteURL(dir string, name string, gitURL string) error
    UpdateRemote(dir, url string) error
    DiscoverRemoteGitURL(gitConf string) (string, error)
    DiscoverUpstreamGitURL(gitConf string) (string, error)
    RemoteBranches(dir string) ([]string, error)
    RemoteBranchNames(dir string, prefix string) ([]string, error)
    GetRemoteUrl(config *gitcfg.Config, name string) string
    RemoteUpdate(dir string) error
    LocalBranches(dir string) ([]string, error)
    Remotes(dir string) ([]string, error)

    Branch(dir string) (string, error)
    CreateBranchFrom(dir string, branchName string, startPoint string) error
    CreateBranch(dir string, branch string) error
    CheckoutRemoteBranch(dir string, branch string) error
    Checkout(dir string, branch string) error
    CheckoutOrphan(dir string, branch string) error
    ConvertToValidBranchName(name string) string
    FetchBranch(dir string, repo string, refspec ...string) error
    FetchBranchShallow(dir string, repo string, refspec ...string) error
    FetchBranchUnshallow(dir string, repo string, refspec ...string) error
    Merge(dir string, commitish string) error
    MergeTheirs(dir string, commitish string) error
    Reset(dir string, commitish string, hard bool) error
    RebaseTheirs(dir string, upstream string, branch string, skipEmpty bool) error
    CherryPick(dir string, commitish string) error

    StashPush(dir string) error
    StashPop(dir string) error

    Remove(dir, fileName string) error
    RemoveForce(dir, fileName string) error
    CleanForce(dir, fileName string) error
    Add(dir string, args ...string) error

    CommitIfChanges(dir string, message string) error
    CommitDir(dir string, message string) error
    AddCommit(dir string, msg string) error
    HasChanges(dir string) (bool, error)
    Diff(dir string) (string, error)
    ListChangedFilesFromBranch(dir string, branch string) (string, error)
    LoadFileFromBranch(dir string, branch string, file string) (string, error)

    GetLatestCommitMessage(dir string) (string, error)
    GetCommitPointedToByPreviousTag(dir string) (string, string, error)
    GetCommitPointedToByLatestTag(dir string) (string, string, error)
    FetchTags(dir string) error
    Tags(dir string) ([]string, error)
    FilterTags(dir string, filter string) ([]string, error)
    CreateTag(dir string, tag string, msg string) error
    GetLatestCommitSha(dir string) (string, error)
    GetCommits(dir string, start string, end string) ([]GitCommit, error)
    RevParse(dir string, rev string) (string, error)
    GetCommitsNotOnAnyRemote(dir string, branch string) ([]GitCommit, error)

    GetRevisionBeforeDate(dir string, t time.Time) (string, error)
    GetRevisionBeforeDateText(dir string, dateText string) (string, error)
    DeleteRemoteBranch(dir string, remoteName string, branch string) error

    SetUpstreamTo(dir string, branch string) error
}

Gitter defines common git actions used by Jenkins X via git cli go:generate pegomock generate github.com/jenkins-x/jx/pkg/gits Gitter -o mocks/gitter.go

func NewGitFake Uses

func NewGitFake() Gitter

NewGitFake creates a new fake Gitter

type GroupAndCommitInfos Uses

type GroupAndCommitInfos struct {
    // contains filtered or unexported fields
}

type Label Uses

type Label struct {
    ID          *int64
    URL         *string
    Name        *string
    Color       *string
    Description *string
    Default     *bool
}

Label represents a label on an Issue

type ListCommitsArguments Uses

type ListCommitsArguments struct {
    SHA     string
    Path    string
    Author  string
    Since   time.Time
    Until   time.Time
    Page    int
    PerPage int
}

type OrganisationChecker Uses

type OrganisationChecker interface {
    IsUserInOrganisation(user string, organisation string) (bool, error)
}

OrganisationChecker verifies if an user is member of an organization go:generate pegomock generate github.com/jenkins-x/jx/pkg/gits OrganisationChecker -o mocks/organisation_checker.go

type OrganisationLister Uses

type OrganisationLister interface {
    ListOrganisations() ([]GitOrganisation, error)
}

OrganisationLister returns a slice of GitOrganisation go:generate pegomock generate github.com/jenkins-x/jx/pkg/gits OrganisationLister -o mocks/organisation_lister.go

type PullRequestDetails Uses

type PullRequestDetails struct {
    Message    string
    BranchName string
    Title      string
}

PullRequestDetails is the details for creating a pull request

func (*PullRequestDetails) String Uses

func (p *PullRequestDetails) String() string

type PullRequestFilter Uses

type PullRequestFilter struct {
    Labels []string
    Number *int
}

A PullRequestFilter defines a filter for finding pull requests

func (*PullRequestFilter) String Uses

func (f *PullRequestFilter) String() string

type PullRequestInfo Uses

type PullRequestInfo struct {
    GitProvider          GitProvider
    PullRequest          *GitPullRequest
    PullRequestArguments *GitPullRequestArguments
}

PullRequestInfo describes a pull request that has been created

func PushRepoAndCreatePullRequest Uses

func PushRepoAndCreatePullRequest(dir string, upstreamRepo *GitRepository, forkRepo *GitRepository, base string, prDetails *PullRequestDetails, filter *PullRequestFilter, commit bool, commitMessage string, push bool, dryRun bool, gitter Gitter, provider GitProvider, labels []string) (*PullRequestInfo, error)

PushRepoAndCreatePullRequest commits and pushes the changes in the repo rooted at dir. It creates a branch called branchName from a base. It uses the pullRequestDetails for the message and title for the commit and PR. It uses and updates pullRequestInfo to identify whether to rebase an existing PR.

Directories

PathSynopsis
features
mocks
mocks/matchersCode generated by pegomock.
operations
releases
testhelpers

Package gits imports 33 packages (graph) and is imported by 52 packages. Updated 2019-09-19. Refresh now. Tools for package owners.