createUnreferencedMergeCommit method
- required String destinationCommitSpecifier,
- required MergeOptionTypeEnum mergeOption,
- required String repositoryName,
- required String sourceCommitSpecifier,
- String? authorName,
- String? commitMessage,
- ConflictDetailLevelTypeEnum? conflictDetailLevel,
- ConflictResolution? conflictResolution,
- ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
- String? email,
- bool? keepEmptyFolders,
Creates an unreferenced commit that represents the result of merging two branches using a specified merge strategy. This can help you determine the outcome of a potential merge. This API cannot be used with the fast-forward merge strategy because that strategy does not create a merge commit.
May throw RepositoryNameRequiredException. May throw InvalidRepositoryNameException. May throw RepositoryDoesNotExistException. May throw TipsDivergenceExceededException. May throw CommitRequiredException. May throw InvalidCommitException. May throw CommitDoesNotExistException. May throw MergeOptionRequiredException. May throw InvalidMergeOptionException. May throw InvalidConflictDetailLevelException. May throw InvalidConflictResolutionStrategyException. May throw InvalidConflictResolutionException. May throw ManualMergeRequiredException. May throw MaximumConflictResolutionEntriesExceededException. May throw MultipleConflictResolutionEntriesException. May throw ReplacementTypeRequiredException. May throw InvalidReplacementTypeException. May throw ReplacementContentRequiredException. May throw InvalidReplacementContentException. May throw PathRequiredException. May throw InvalidPathException. May throw FileContentSizeLimitExceededException. May throw FolderContentSizeLimitExceededException. May throw MaximumFileContentToLoadExceededException. May throw MaximumItemsToCompareExceededException. May throw ConcurrentReferenceUpdateException. May throw FileModeRequiredException. May throw InvalidFileModeException. May throw NameLengthExceededException. May throw InvalidEmailException. May throw CommitMessageLengthExceededException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.
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 mergeOption
:
The merge option or strategy you want to use to merge the code.
Parameter repositoryName
:
The name of the repository where you want to create the unreferenced merge
commit.
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 authorName
:
The name of the author who created the unreferenced commit. This
information is used as both the author and committer for the commit.
Parameter commitMessage
:
The commit message for the unreferenced commit.
Parameter conflictDetailLevel
:
The level of conflict detail to use. If unspecified, the default
FILE_LEVEL is used, which returns a not-mergeable result if the same file
has differences in both branches. If LINE_LEVEL is specified, a conflict
is considered not mergeable if the same file in both branches has
differences on the same line.
Parameter conflictResolution
:
If AUTOMERGE is the conflict resolution strategy, a list of inputs to use
when resolving conflicts during a merge.
Parameter conflictResolutionStrategy
:
Specifies which branch to use when resolving conflicts, or whether to
attempt automatically merging two versions of a file. The default is NONE,
which requires any conflicts to be resolved manually before the merge
operation is successful.
Parameter email
:
The email address for the person who created the unreferenced commit.
Parameter keepEmptyFolders
:
If the commit contains deletions, whether to keep a folder or folder
structure if the changes leave the folders empty. If this is specified as
true, a .gitkeep file is created for empty folders. The default is false.
Implementation
Future<CreateUnreferencedMergeCommitOutput> createUnreferencedMergeCommit({
required String destinationCommitSpecifier,
required MergeOptionTypeEnum mergeOption,
required String repositoryName,
required String sourceCommitSpecifier,
String? authorName,
String? commitMessage,
ConflictDetailLevelTypeEnum? conflictDetailLevel,
ConflictResolution? conflictResolution,
ConflictResolutionStrategyTypeEnum? conflictResolutionStrategy,
String? email,
bool? keepEmptyFolders,
}) async {
ArgumentError.checkNotNull(
destinationCommitSpecifier, 'destinationCommitSpecifier');
ArgumentError.checkNotNull(mergeOption, 'mergeOption');
ArgumentError.checkNotNull(repositoryName, 'repositoryName');
_s.validateStringLength(
'repositoryName',
repositoryName,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(sourceCommitSpecifier, 'sourceCommitSpecifier');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeCommit_20150413.CreateUnreferencedMergeCommit'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'destinationCommitSpecifier': destinationCommitSpecifier,
'mergeOption': mergeOption.toValue(),
'repositoryName': repositoryName,
'sourceCommitSpecifier': sourceCommitSpecifier,
if (authorName != null) 'authorName': authorName,
if (commitMessage != null) 'commitMessage': commitMessage,
if (conflictDetailLevel != null)
'conflictDetailLevel': conflictDetailLevel.toValue(),
if (conflictResolution != null)
'conflictResolution': conflictResolution,
if (conflictResolutionStrategy != null)
'conflictResolutionStrategy': conflictResolutionStrategy.toValue(),
if (email != null) 'email': email,
if (keepEmptyFolders != null) 'keepEmptyFolders': keepEmptyFolders,
},
);
return CreateUnreferencedMergeCommitOutput.fromJson(jsonResponse.body);
}