【发布时间】:2022-01-14 14:17:38
【问题描述】:
我正在尝试使用 Azure DevOps Services Rest API 从 master 创建一个新分支,但没有成功。
主体:
[
{
"name": "refs/heads/new-test-branch-from-api-call",
"oldObjectId": "{{masterObjectId}}",
"newObjectId": "{{newObjectId}}"
}
]
结果:
{
"$id": "1",
"innerException": null,
"message": "TF401035: The object '****************************************' does not exist.",
"typeName": "Microsoft.TeamFoundation.Git.Server.GitObjectDoesNotExistException, Microsoft.TeamFoundation.Git.Server",
"typeKey": "GitObjectDoesNotExistException",
"errorCode": 0,
"eventId": 3000
}
this 帖子上的评论指出这是要采取的路线。还指出应该使用 repositoryId 和 newObjectId 导致:
{
"$id": "1",
"innerException": null,
"message": "An object ID must be 40 characters long and only have hex digits. Passed in object ID: ********-****-****-****-************.",
"typeName": "System.ArgumentException, mscorlib",
"typeKey": "ArgumentException",
"errorCode": 0,
"eventId": 0
}
【问题讨论】:
标签: azure azure-devops branch azure-devops-rest-api