use of com.meisolsson.githubsdk.model.request.pull_request.MergeRequest in project gh4a by slapperwan.
the class PullRequestActivity method mergePullRequest.
private void mergePullRequest(String commitMessage, MergeRequest.Method mergeMethod) {
String errorMessage = getString(R.string.pull_error_merge, mPullRequest.number());
PullRequestService service = ServiceFactory.get(PullRequestService.class, false);
MergeRequest request = MergeRequest.builder().commitMessage(commitMessage).method(mergeMethod).build();
service.mergePullRequest(mRepoOwner, mRepoName, mPullRequestNumber, request).map(ApiHelpers::throwOnFailure).compose(RxUtils.wrapForBackgroundTask(this, R.string.merging_msg, errorMessage)).subscribe(result -> {
if (result.merged()) {
mPullRequest = mPullRequest.toBuilder().merged(true).state(IssueState.Closed).build();
}
handlePullRequestUpdate();
}, error -> handleActionFailure("Merging pull request failed", error));
}
Aggregations