Skip to content
GitmoapAPIBeta
Reviewmerge-requests
GET/repositories/{repo_id}/merge-requests/{mr_id}/conflicts

Get a merge request's conflicts

get_mr_conflicts
  • diff:read
    A token needs the diff:read scope: View commit, merge-request, and branch-comparison diffsGranted by mcp_agent, mcp_agent_write, read_api, read_repository, write_api, write_repository.Every operation this scope unlocks
  • Metered egress · in band body

    x-gitmoap-egress: {"kind":"metered","arg":"in_band_body"}

  • Cacheable · derived SHA artifact

    x-gitmoap-cache: {"kind":"derived_sha_artifact"}

  • Conditional · 304
    Declares 304 Not Modified.

Every file that conflicts between the merge request's branch and its target, as git's merge sees it — each text conflict split into the lines both sides agree on and the blocks where they differ. A pure function of the two branch heads: when they have not moved, the answer has not either. A conflict set the browser cannot resolve says why, and is resolved with git.

Parameters

Path
  • repo_idRepositoryId (string · uuid)Repository ID
  • mr_idMergeRequestId (integer · int64)Merge request ID

Responses

200The conflicts between the two branch heads. When there are none, or they cannot be resolved here, `resolvable` is false and `refusal` says whyapplication/json
  • filesarray of ConflictFile
    • The ConflictFile schema
    • kindConflictKindcontentadd_addmodify_deletedelete_modifybinarymoderenamefile_directorysubmoduleotherWhat kind of conflict a file has. Closed: a client offers different choices for each.
    • pathstring
    • resolvablebooleanWhether this file can be resolved in the browser.
    • sectionsarray of ConflictSectionThe file as runs and blocks, for a content or add_add conflict the browser can resolve. Empty for every other kind, which is resolved by a choice of the whole file.
    • old_pathstring or nulloptionalWhere the file was before a rename, when a rename is part of the conflict.
    • refusalstring or nulloptionalWhy not, when it cannot.
    • source_modeFileMode100644100755120000160000or nulloptionalThe file's mode on the merge request's branch; absent where that side has no file.
    • target_modeFileMode100644100755120000160000or nulloptionalThe file's mode on the target branch; absent where that side has no file.
  • resolvablebooleanWhether every conflict can be resolved in the browser. When false, refusal says why.
  • source_branchBranchName (string)
  • source_shaCommitHash (string)
  • target_branchBranchName (string)
  • target_shaCommitHash (string)
  • merge_base_shaCommitHash (string) or nulloptionalWhere the two branches diverged; absent when they share no history.
  • refusalRefusal or nulloptional
    • The Refusal schema
    • codeRefusalCodePERMISSION_REQUIREDBRANCH_PROTECTEDAGENT_REFFOREIGN_AUTHORPRIVILEGED_PATHBRANCH_NOT_FOUNDSTART_BRANCH_NOT_FOUNDFILE_NOT_FOUNDREPOSITORY_EMPTYMR_NOT_OPENNOT_CONFLICTEDHEAD_MOVEDBRANCH_EXISTSFILE_CHANGEDFILE_EXISTSPATH_CONFLICTUNSUPPORTED_ENTRYNOTHING_TO_COMMITUNRESOLVEDNOT_IN_CONFLICTUNSUPPORTED_CONFLICTPUSH_RULE_VIOLATIONWhat kind of refusal this is. Closed: a client branches on it. The wire spelling is the SCREAMING_SNAKE domain code that leads an error's message, so a refusal returned as data and the same refusal returned as an error read the same.
    • messagestringWhat is wrong, in a sentence a person can act on.
    • fieldstring or nulloptionalThe part of the request the refusal is about: message, branch, or actions[i] for the i-th file change.
    • rulestring or nulloptionalThe push rule that refused, by its setting's name (require_issue_reference), when code is PUSH_RULE_VIOLATION.
200 exampleSynthesized example
{
"files": [
{
"kind": "content",
"path": "path-eaff",
"resolvable": false,
"sections": []
},
{
"kind": "content",
"path": "path-be9c",
"resolvable": false,
"sections": []
}
],
"resolvable": false,
"source_branch": "refactor/brand-inline",
"source_sha": "7da06fb7cdc3869ed82bace7645e5535bd4c0cbb",
"target_branch": "main",
"target_sha": "17e21d1a464a18fb596bbfc9434a55f785a95b64",
"merge_base_sha": "831e15e7144a955a1ca1ee264441dcafa3f085a3",
"refusal": {
"code": "PERMISSION_REQUIRED",
"message": "Draw the region map from operation density",
"field": "field-4e85",
"rule": "rule-8f2c"
}
}
304The branch heads have not moved since the validator was issued

No body.

400Bad request — a path parameter is not a well-formed value of its typeapplication/json
Error codes
  • BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-7645",
"message": "Stream pipeline status into the run header"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
  • UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-2b89",
"message": "Inline scalar newtypes but keep their brand"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names it
  • PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-cc34",
"message": "Inline scalar newtypes but keep their brand"
}
}
404Repository or merge request not foundapplication/json
Error codes
  • NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-6476",
"message": "Inline scalar newtypes but keep their brand"
}
}

CLI

gitmoap mr get-conflicts

  • --repo-ididRepository ID (id or owner/repo path)
  • --mr-ididMerge request ID

Used in these guides