是否可以检查rest api或tf.exe或任何客户端库api锁定了哪个分支?
我尝试按照本文https://docs.microsoft.com/en-us/rest/api/azure/devops/git/refs/list?view=azure-devops-rest-5.0#gitref进行操作,并且响应中不包含锁定/未锁定标志。
谢谢。
答案 0 :(得分:0)
您正在使用正确的Rest API。
GET https://{instance}/{collection}/{project}/_apis/git/repositories/{repositoryId}/refs?filter=heads/xxx &api-version=5.0
请检查您的URI Parameters,只需确保使用正确的过滤器即可。
返回的json文件应该有 isLocked 和 isLockedBy 信息。
答案 1 :(得分:0)
https://{baseUrl}/{organisation}/{project}/_apis/git/repositories/{repoId}/refs?filter=heads/***/master&api-version=6.0
这里有一个问题,如果你的分支没有被锁定,那么“Islocked”和“Creator”部分将永远不会得到响应。
要获取所有分支信息,您可以在没有过滤器的情况下运行 url
例如。
https://{baseUrl}/{organisation}/{project}/_apis/git/repositories/{repoId}/refs?&api-version=6.0