更新时间:2025-07-15 GMT+08:00
分享

获取所有的冲突文件

功能介绍

获取所有的冲突文件

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v4/repositories/{repository_id}/merge-requests/{merge_request_iid}/conflict-files

表1 路径参数

参数

是否必选

参数类型

描述

repository_id

Integer

参数解释:

仓库的ID,通过查询用户所有仓库接口查询项目列表获取。

约束限制:

不涉及。

取值范围:

1-2147483647

merge_request_iid

Integer

参数解释:

合并请求 iid。

取值范围:

1-2147483647

表2 Query参数

参数

是否必选

参数类型

描述

offset

Integer

参数解释:

偏移量,从0开始。

取值范围:

0-2147483647

默认取值:

0

limit

Integer

参数解释:

返回数量。

取值范围:

1-100

默认取值:

20

hide_content

Boolean

参数解释:

如为true,隐藏文件冲突详情

默认取值:

false

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释:

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

约束限制:

必传。

取值范围:

字符串长度不少于1,不超过10万。

默认取值:

不涉及。

响应参数

状态码:200

表4 响应Body参数

参数

参数类型

描述

[数组元素]

Array of MRConflictFileDto objects

冲突文件详情

表5 MRConflictFileDto

参数

参数类型

描述

old_path

String

参数解释:

旧文件名称。

new_path

String

参数解释:

新文件名称。

blob_icon

String

blob_icon

blob_path

String

blob 路径

conflict_type

String

冲突类型

content

String

内容

content_path

String

内容路径

sections

Array of ConflictSectionDto objects

片段

type

String

类型

error_message

String

错误信息

表6 ConflictSectionDto

参数

参数类型

描述

conflict

Boolean

是否冲突

lines

Array of ConflictSectionLineDto objects

冲突行列表

id

String

编号

表7 ConflictSectionLineDto

参数

参数类型

描述

line_code

String

type

String

类型

old_line

Integer

旧行

new_line

Integer

新行

text

String

文本

meta_data

ConflictSectionLineMetaDataDto object

元数据

rich_text

String

富文本

can_receive_suggestion

Boolean

可接受建议

表8 ConflictSectionLineMetaDataDto

参数

参数类型

描述

old_pos

Integer

旧列位置

new_pos

Integer

新列位置

状态码:401

表9 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码。

error_msg

String

参数解释:

错误信息。

请求示例

GET https://{endpoint}/v4/repositories/2112015538/merge-requests/1/conflict-files

响应示例

状态码:401

Unauthorized

{
  "error_code" : "DEV.00000003",
  "error_msg" : "认证信息过期"
}

状态码

状态码

描述

200

获取所有的冲突文件

401

Unauthorized

错误码

请参见错误码

相关文档