mergeBranchesByFastForward method
Merges two branches using the fast-forward merge strategy.
May throw BranchDoesNotExistException.
May throw BranchNameIsTagNameException.
May throw BranchNameRequiredException.
May throw CommitDoesNotExistException.
May throw CommitRequiredException.
May throw ConcurrentReferenceUpdateException.
May throw EncryptionIntegrityChecksFailedException.
May throw EncryptionKeyAccessDeniedException.
May throw EncryptionKeyDisabledException.
May throw EncryptionKeyNotFoundException.
May throw EncryptionKeyUnavailableException.
May throw InvalidBranchNameException.
May throw InvalidCommitException.
May throw InvalidRepositoryNameException.
May throw InvalidTargetBranchException.
May throw ManualMergeRequiredException.
May throw RepositoryDoesNotExistException.
May throw RepositoryNameRequiredException.
May throw TipsDivergenceExceededException.
Parameter destinationCommitSpecifier :
The branch, tag, HEAD, or other fully qualified reference used to identify
a commit (for example, a branch name or a full commit ID).
Parameter repositoryName :
The name of the repository where you want to merge two branches.
Parameter sourceCommitSpecifier :
The branch, tag, HEAD, or other fully qualified reference used to identify
a commit (for example, a branch name or a full commit ID).
Parameter targetBranch :
The branch where the merge is applied.
Implementation
Future<MergeBranchesByFastForwardOutput> mergeBranchesByFastForward({
required String destinationCommitSpecifier,
required String repositoryName,
required String sourceCommitSpecifier,
String? targetBranch,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.MergeBranchesByFastForward'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'destinationCommitSpecifier': destinationCommitSpecifier,
'repositoryName': repositoryName,
'sourceCommitSpecifier': sourceCommitSpecifier,
if (targetBranch != null) 'targetBranch': targetBranch,
},
);
return MergeBranchesByFastForwardOutput.fromJson(jsonResponse.body);
}