Octokit.PullRequestsClient.Merge C# (CSharp) Method

Merge() public method

Merge a pull request.
http://developer.github.com/v3/pulls/#merge-a-pull-request-merge-buttontrade
public Merge ( long repositoryId, int number, Octokit.MergePullRequest mergePullRequest ) : Task
repositoryId long The Id of the repository
number int The pull request number
mergePullRequest Octokit.MergePullRequest A instance describing a pull request merge
return Task
        public async Task<PullRequestMerge> Merge(long repositoryId, int number, MergePullRequest mergePullRequest)
        {
            Ensure.ArgumentNotNull(mergePullRequest, "mergePullRequest");

            try
            {
                var endpoint = ApiUrls.MergePullRequest(repositoryId, number);
                return await ApiConnection.Put<PullRequestMerge>(endpoint, mergePullRequest, null, AcceptHeaders.SquashCommitPreview).ConfigureAwait(false);
            }
            catch (ApiException ex)
            {
                if (ex.StatusCode == HttpStatusCode.MethodNotAllowed)
                {
                    throw new PullRequestNotMergeableException(ex.HttpResponse);
                }

                if (ex.StatusCode == HttpStatusCode.Conflict)
                {
                    throw new PullRequestMismatchException(ex.HttpResponse);
                }

                throw;
            }
        }

Same methods

PullRequestsClient::Merge ( string owner, string name, int number, Octokit.MergePullRequest mergePullRequest ) : Task