Search in sources :

Example 1 with MergeBranchesByFastForwardResponse

use of software.amazon.awssdk.services.codecommit.model.MergeBranchesByFastForwardResponse in project aws-doc-sdk-examples by awsdocs.

the class MergeBranches method merge.

// snippet-start:[codecommit.java2.merge.main]
public static void merge(CodeCommitClient codeCommitClient, String repoName, String targetBranch, String sourceReference, String destinationCommitId) {
    try {
        MergeBranchesByFastForwardRequest fastForwardRequest = MergeBranchesByFastForwardRequest.builder().destinationCommitSpecifier(destinationCommitId).targetBranch(targetBranch).sourceCommitSpecifier(sourceReference).repositoryName(repoName).build();
        MergeBranchesByFastForwardResponse response = codeCommitClient.mergeBranchesByFastForward(fastForwardRequest);
        System.out.println("The commit id is " + response.commitId());
    } catch (CodeCommitException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : CodeCommitException(software.amazon.awssdk.services.codecommit.model.CodeCommitException) MergeBranchesByFastForwardRequest(software.amazon.awssdk.services.codecommit.model.MergeBranchesByFastForwardRequest) MergeBranchesByFastForwardResponse(software.amazon.awssdk.services.codecommit.model.MergeBranchesByFastForwardResponse)

Aggregations

CodeCommitException (software.amazon.awssdk.services.codecommit.model.CodeCommitException)1 MergeBranchesByFastForwardRequest (software.amazon.awssdk.services.codecommit.model.MergeBranchesByFastForwardRequest)1 MergeBranchesByFastForwardResponse (software.amazon.awssdk.services.codecommit.model.MergeBranchesByFastForwardResponse)1