public class

PullRequestMergeRequest

extends AbstractPullRequestRequest
java.lang.Object
   ↳ com.atlassian.stash.pull.AbstractPullRequestRequest
     ↳ com.atlassian.stash.pull.PullRequestMergeRequest

Class Overview

Describes a request to merge a PullRequest.

Summary

Nested Classes
class PullRequestMergeRequest.Builder  
Public Methods
@Nonnull Map<StringObject> getContext()
Retrieves additional supplementary context for the merge request.
@Nullable String getMessage()
Retrieves the commit message to use when merging the pull request.
int getVersion()
Retrieves the expected version for the pull request.
[Expand]
Inherited Methods
From class com.atlassian.stash.pull.AbstractPullRequestRequest
From class java.lang.Object

Public Methods

@Nonnull public Map<StringObject> getContext ()

Retrieves additional supplementary context for the merge request. This context is passed as-is to all of the MergeRequestChecks run before the merge is performed and is also included in the PullRequestMergedEvent raised after the merge is completed.

Returns
  • a map of additional context, which may be empty but is never null

@Nullable public String getMessage ()

Retrieves the commit message to use when merging the pull request.

While this is part of the API for merging pull requests, the underlying SCM performing the merge ultimately decides the exact shape of the final commit message. For example, when performing a fast-forward "merge" in Git, any commit message provided here is ignored because the "merge" does not actually create a new commit. Additionally, the SCM may, at its own discretion, augment the provided commit message with more detail. For example, the Git SCM includes the summary from each merged commit in the message.

The system has a base message that is always applied when merging pull requests. If a message is provided here, it will be appended to that base message.

Returns
  • the commit message for the pull request

public int getVersion ()

Retrieves the expected version for the pull request. If the pull request's actual version does not match, a PullRequestOutOfDateException will be thrown to indicate that the merge was requested on stale data.

Returns
  • the pull request version to merge