我想使用 WebApi 和 GitHttpClient
来查找一些 Git 标签并识别一些标签对之间的提交。
我设法通过使用gitClient.GetRefsAsync(gitRepository.Id)
获取标签,但我不知道如何获取标签指向的提交。
换句话说,我不知道如何从GitRef
对象获取提交 ID。
https://learn.microsoft.com/en-us/dotnet/api/microsoft.teamfoundation.sourcecontrol.webapi.gitref
调用 GetRefsAsync
时,需要设置:peelTags: true
。然后,提交 Id 将作为GitRef
对象的PeeledObjectId
属性返回。