Skip to main content
GET
/
api
/
v1
/
repos
/
merge
/
preview
Preview Merge
curl --request GET \
  --url https://api.{cluster}.code.storage/api/v1/repos/merge/preview \
  --header 'Authorization: Bearer <token>'
{
  "conflicts": [
    {
      "base": {
        "binary": false,
        "oid": "1111111111111111111111111111111111111111",
        "truncated": false
      },
      "ours": {
        "binary": false,
        "oid": "1111111111111111111111111111111111111111",
        "truncated": false
      },
      "path": "docs/conflict.txt",
      "result": {
        "binary": false,
        "oid": "1111111111111111111111111111111111111111",
        "truncated": false
      },
      "theirs": {
        "binary": false,
        "oid": "1111111111111111111111111111111111111111",
        "truncated": false
      }
    }
  ],
  "filtered_conflicts": [
    {
      "path": "src/app.ts",
      "reason": "max_conflict_files_exceeded"
    }
  ],
  "merge_base_sha": "a2d127e6a4d54bb7390de828a99e36411f0c84df",
  "result": "merge_commit",
  "source_branch": "feature/preview",
  "source_tip_sha": "9eb378bdb5bf1944f6ba0bd5a2c4df3ce32f4df1",
  "status": "conflicted",
  "target_branch": "main",
  "target_tip_sha": "c4f0fdfc41adab56630b34f5f4fd4e84a2c5b4d2"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

source_branch
string
required

Source branch to merge from.

target_branch
string
required

Destination branch to preview merging into.

include_content
boolean

When true, include bounded conflict content in the response.

Response

Merge preview result. Conflicted previews return HTTP 200 with status=conflicted; request and storage failures use normal HTTP errors.

Read-only merge preview result, including clean or conflicted status and optional inline conflict content.

conflict_paths
string[]
required

Repository paths that conflicted during the merge preview.

conflicts
object[]
required

Inline conflict content, populated only when include_content=true.

result
enum<string>
required

Operation result if applied: merge_commit, fast_forward, or no_op.

Available options:
merge_commit,
fast_forward,
no_op
Example:

"merge_commit"

source_branch
string
required

Source branch requested by the caller.

Example:

"feature/preview"

source_tip_sha
string
required

Resolved source branch tip SHA.

Example:

"9eb378bdb5bf1944f6ba0bd5a2c4df3ce32f4df1"

status
enum<string>
required

Preview status: clean or conflicted.

Available options:
clean,
conflicted
Example:

"conflicted"

target_branch
string
required

Target branch requested by the caller.

Example:

"main"

target_tip_sha
string
required

Resolved target branch tip SHA.

Example:

"c4f0fdfc41adab56630b34f5f4fd4e84a2c5b4d2"

filtered_conflicts
object[]

Conflicts omitted from inline content because of request or server limits.

merge_base_sha
string

Merge base SHA used for the preview.

Example:

"a2d127e6a4d54bb7390de828a99e36411f0c84df"