Merges - Get

获取特定合并作的详细信息。

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}?api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}?includeLinks={includeLinks}&api-version=7.1

URI 参数

名称 必需 类型 说明
mergeOperationId
path True

integer (int32)

合并请求的 OperationId。

organization
path True

string

Azure DevOps 组织的名称。

project
path True

string

项目 ID 或项目名称

repositoryNameOrId
path True

string

存储库的名称或 ID。

api-version
query True

string

要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。

includeLinks
query

boolean

True 以包含链接

响应

名称 类型 说明
200 OK

GitMerge

成功作

安全性

oauth2

类型: oauth2
流向: accessCode
授权 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
令牌 URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

作用域

名称 说明
vso.code 授予读取有关提交、更改集、分支和其他版本控制项目的源代码和元数据的能力。 此外,还可以通过服务挂钩搜索代码并获取有关版本控制事件的通知。

示例

Get the details of the merge request.

示例请求

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}?api-version=7.1

示例响应

{
  "mergeOperationId": 1,
  "status": "completed",
  "detailedStatus": {
    "mergeCommitId": "7e7460f6b61bbaa7cc2b52e4c33c0fb44d65ef9a"
  },
  "parents": [
    "638b0477e874c08482009a1ac6912b504e197ef1",
    "c34676c51971f4a89190d5b9bd7fef5368e26f17"
  ],
  "comment": "Test 1 "
}

定义

名称 说明
GitAsyncOperationStatus
GitMerge
GitMergeOperationStatusDetail

有关请求的合并作的状态信息。

ReferenceLinks

表示 REST 引用链接集合的类。

GitAsyncOperationStatus

说明
abandoned

该作已被放弃。

completed

作已完成。

failed

作失败。 检查是否有错误消息。

inProgress

该作当前正在进行中。

queued

该作正在队列中等待,但尚未启动。

GitMerge

名称 类型 说明
_links

ReferenceLinks

参考链接。

comment

string

提交注释或消息。

detailedStatus

GitMergeOperationStatusDetail

合并作的详细状态。

mergeOperationId

integer (int32)

合并作的唯一标识符。

parents

string[]

合并提交的父提交 ID 的枚举。

status

GitAsyncOperationStatus

合并作的状态。

GitMergeOperationStatusDetail

有关请求的合并作的状态信息。

名称 类型 说明
failureMessage

string

如果作失败,则显示错误消息。

mergeCommitId

string

生成的合并提交的 commitId。

表示 REST 引用链接集合的类。

名称 类型 说明
links

object

链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读链接。