Class MergeCommandParameters


public class MergeCommandParameters extends AbstractMergeCommandParameters
  • Constructor Details

  • Method Details

    • getFromBranch

      @Nonnull public String getFromBranch()
    • getFromCommitId

      @Nullable public String getFromCommitId()
      Retrieves the specific commit that should be merged into the target branch.

      If this value is not provided, the current tip of the source branch is merged into the target. This should be used with caution, as it may result in the system performing a different merge than intended if the source branch changes between when the merge is requested and when it is performed.

      Returns:
      the specific commit to merge in, or null to merge the current tip of the branch
    • getFromRepository

      @Nullable public Repository getFromRepository()
      Retrieves the repository containing the from getFromBranch() and commit.
      Returns:
      the from repository, or null if the from and to branches are in the same repository
    • getToBranch

      @Nonnull public String getToBranch()
    • getToCommitId

      @Nullable public String getToCommitId()
      Retrieves the specific commit that the target branch should be at.

      If this value is provided and the current tip of target branch does not match this value, the merge will not be performed and an exception will be thrown.

      If this value is not provided, the merge will occur on top of the current tip of the target branch.

      Returns:
      the specific commit that the target branch should be at, or null to perform the merge on top of the current tip of the target branch
      Since:
      7.8
    • hasFromRepository

      public boolean hasFromRepository()
      Retrieves a flag indicating whether these parameters include a from repository, indicating the merge is cross-repository, where the to repository is provided when requesting the merge command rather than in these parameters.
      Returns:
      true if a from repository is set; otherwise, false