- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
DescribeMergeConflictsCommand
Returns information about one or more merge conflicts in the attempted merge of two commit specifiers using the squash or three-way merge strategy. If the merge option for the attempted merge is specified as FAST_FORWARD_MERGE, an exception is thrown.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CodeCommitClient, DescribeMergeConflictsCommand } from "@aws-sdk/client-codecommit"; // ES Modules import
// const { CodeCommitClient, DescribeMergeConflictsCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import
const client = new CodeCommitClient(config);
const input = { // DescribeMergeConflictsInput
repositoryName: "STRING_VALUE", // required
destinationCommitSpecifier: "STRING_VALUE", // required
sourceCommitSpecifier: "STRING_VALUE", // required
mergeOption: "FAST_FORWARD_MERGE" || "SQUASH_MERGE" || "THREE_WAY_MERGE", // required
maxMergeHunks: Number("int"),
filePath: "STRING_VALUE", // required
conflictDetailLevel: "FILE_LEVEL" || "LINE_LEVEL",
conflictResolutionStrategy: "NONE" || "ACCEPT_SOURCE" || "ACCEPT_DESTINATION" || "AUTOMERGE",
nextToken: "STRING_VALUE",
};
const command = new DescribeMergeConflictsCommand(input);
const response = await client.send(command);
// { // DescribeMergeConflictsOutput
// conflictMetadata: { // ConflictMetadata
// filePath: "STRING_VALUE",
// fileSizes: { // FileSizes
// source: Number("long"),
// destination: Number("long"),
// base: Number("long"),
// },
// fileModes: { // FileModes
// source: "EXECUTABLE" || "NORMAL" || "SYMLINK",
// destination: "EXECUTABLE" || "NORMAL" || "SYMLINK",
// base: "EXECUTABLE" || "NORMAL" || "SYMLINK",
// },
// objectTypes: { // ObjectTypes
// source: "FILE" || "DIRECTORY" || "GIT_LINK" || "SYMBOLIC_LINK",
// destination: "FILE" || "DIRECTORY" || "GIT_LINK" || "SYMBOLIC_LINK",
// base: "FILE" || "DIRECTORY" || "GIT_LINK" || "SYMBOLIC_LINK",
// },
// numberOfConflicts: Number("int"),
// isBinaryFile: { // IsBinaryFile
// source: true || false,
// destination: true || false,
// base: true || false,
// },
// contentConflict: true || false,
// fileModeConflict: true || false,
// objectTypeConflict: true || false,
// mergeOperations: { // MergeOperations
// source: "A" || "M" || "D",
// destination: "A" || "M" || "D",
// },
// },
// mergeHunks: [ // MergeHunks // required
// { // MergeHunk
// isConflict: true || false,
// source: { // MergeHunkDetail
// startLine: Number("int"),
// endLine: Number("int"),
// hunkContent: "STRING_VALUE",
// },
// destination: {
// startLine: Number("int"),
// endLine: Number("int"),
// hunkContent: "STRING_VALUE",
// },
// base: {
// startLine: Number("int"),
// endLine: Number("int"),
// hunkContent: "STRING_VALUE",
// },
// },
// ],
// nextToken: "STRING_VALUE",
// destinationCommitId: "STRING_VALUE", // required
// sourceCommitId: "STRING_VALUE", // required
// baseCommitId: "STRING_VALUE",
// };
DescribeMergeConflictsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
destinationCommitSpecifier Required | string | undefined | The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID). |
filePath Required | string | undefined | The path of the target files used to describe the conflicts. |
mergeOption Required | MergeOptionTypeEnum | undefined | The merge option or strategy you want to use to merge the code. |
repositoryName Required | string | undefined | The name of the repository where you want to get information about a merge conflict. |
sourceCommitSpecifier Required | string | undefined | The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID). |
conflictDetailLevel | ConflictDetailLevelTypeEnum | undefined | 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. |
conflictResolutionStrategy | ConflictResolutionStrategyTypeEnum | undefined | 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. |
maxMergeHunks | number | undefined | The maximum number of merge hunks to include in the output. |
nextToken | string | undefined | An enumeration token that, when provided in a request, returns the next batch of the results. |
DescribeMergeConflictsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
conflictMetadata Required | ConflictMetadata | undefined | Contains metadata about the conflicts found in the merge. |
destinationCommitId Required | string | undefined | The commit ID of the destination commit specifier that was used in the merge evaluation. |
mergeHunks Required | MergeHunk[] | undefined | A list of merge hunks of the differences between the files or lines. |
sourceCommitId Required | string | undefined | The commit ID of the source commit specifier that was used in the merge evaluation. |
baseCommitId | string | undefined | The commit ID of the merge base. |
nextToken | string | undefined | An enumeration token that can be used in a request to return the next batch of the results. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
CommitDoesNotExistException | client | The specified commit does not exist or no commit was specified, and the specified repository has no default branch. |
CommitRequiredException | client | A commit was not specified. |
EncryptionIntegrityChecksFailedException | server | An encryption integrity check failed. |
EncryptionKeyAccessDeniedException | client | An encryption key could not be accessed. |
EncryptionKeyDisabledException | client | The encryption key is disabled. |
EncryptionKeyNotFoundException | client | No encryption key was found. |
EncryptionKeyUnavailableException | client | The encryption key is not available. |
FileDoesNotExistException | client | The specified file does not exist. Verify that you have used the correct file name, full path, and extension. |
InvalidCommitException | client | The specified commit is not valid. |
InvalidConflictDetailLevelException | client | The specified conflict detail level is not valid. |
InvalidConflictResolutionStrategyException | client | The specified conflict resolution strategy is not valid. |
InvalidContinuationTokenException | client | The specified continuation token is not valid. |
InvalidMaxMergeHunksException | client | The specified value for the number of merge hunks to return is not valid. |
InvalidMergeOptionException | client | The specified merge option is not valid for this operation. Not all merge strategies are supported for all operations. |
InvalidPathException | client | The specified path is not valid. |
InvalidRepositoryNameException | client | A specified repository name is not valid. This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist. |
MaximumFileContentToLoadExceededException | client | The number of files to load exceeds the allowed limit. |
MaximumItemsToCompareExceededException | client | The number of items to compare between the source or destination branches and the merge base has exceeded the maximum allowed. |
MergeOptionRequiredException | client | A merge option or stategy is required, and none was provided. |
PathRequiredException | client | The folderPath for a location cannot be null. |
RepositoryDoesNotExistException | client | The specified repository does not exist. |
RepositoryNameRequiredException | client | A repository name is required, but was not specified. |
TipsDivergenceExceededException | client | The divergence between the tips of the provided commit specifiers is too great to determine whether there might be any merge conflicts. Locally compare the specifiers using |
CodeCommitServiceException | Base exception class for all service exceptions from CodeCommit service. |