Reputation: 119
I am trying to get the list of files that changed in a commit in AzureDevOps. Is there an api to get this information ?
I am using this but not able to get the information for files.
var attachment = buildClient.GetAttachmentsAsync(projectName, buildRunId, commititem.Type).Result;
The above code returns empty value.
Upvotes: 1
Views: 1425
Reputation: 35194
Is there an api to get this information ?
Yes. You can get the file names in a commit with this API: Commits - Get Changes
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/changes?api-version=6.0
For .net sdk, you can refer to this class: GitCommitChanges Class
Upvotes: 1