【发布时间】:2021-02-18 22:18:23
【问题描述】:
Azure DevOps REST API 中有一个推送客户端,允许使用新提交创建推送。我按照in here 提供的示例进行了操作,但是没有一个要更改文件编码的示例。我尝试在请求负载中提供必要的编码,如下所示:
"refUpdates": [{ "name": "refs/heads/master", "oldObjectId": "..." }],
"commits": [{
"comment": "Comment",
"changes": [{
"changeType": 2, // also tried type "4" which stands for "Encoding"
"item": {
"path": "...",
"contentMetadata": { "encoding": 1252 } // UTF-8
},
"newContent": { content: "New content", contentType: 0 },
}]
}]
但它什么也没做,“contentMetadata”字段似乎被 Pushes 客户端忽略了。
有没有办法使用 Azure DevOps REST API 更改文件编码?
【问题讨论】:
标签: git azure-devops azure-devops-rest-api azure-repos