updateDefaultBranch method
Sets or changes the default branch name for the specified repository.
May throw BranchDoesNotExistException.
May throw BranchNameRequiredException.
May throw EncryptionIntegrityChecksFailedException.
May throw EncryptionKeyAccessDeniedException.
May throw EncryptionKeyDisabledException.
May throw EncryptionKeyNotFoundException.
May throw EncryptionKeyUnavailableException.
May throw InvalidBranchNameException.
May throw InvalidRepositoryNameException.
May throw RepositoryDoesNotExistException.
May throw RepositoryNameRequiredException.
Parameter defaultBranchName :
The name of the branch to set as the default branch.
Parameter repositoryName :
The name of the repository for which you want to set or change the default
branch.
Implementation
Future<void> updateDefaultBranch({
required String defaultBranchName,
required String repositoryName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.UpdateDefaultBranch'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'defaultBranchName': defaultBranchName,
'repositoryName': repositoryName,
},
);
}