-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
The api call:
getCommitsBatch(searchCriteria: Git.GitQueryCommitsCriteria, repositoryId: string, project?: string, skip?: number, top?: number, includeStatuses?: boolean): Promise<Git.GitCommitRef[]>;
Results in the error message:
POST:
https://{instance}/{collection}/{project}/_apis/git/repositories/GUID/CommitsBatch?%24skip=0&%24top=1&includeStatuses=false
400 (Bad Request)
I can copy the uri from the error message, paste it into postman and add: "&api-version=7.0" (and use a generated PAT for Basic authentication) and get 200 OK.
Code used to call the function:
let criteria: GitQueryCommitsCriteria = EmptyGitQueryCommitsCriteria;
const MaxCommitsAllowedByApi = 1; // want to use 50000 here when I fix this.
criteria.$top = MaxCommitsAllowedByApi;
criteria.itemPath = ....;
commits = await gitClient.getCommitsBatch(criteria, repoId, projectName, 0, MaxCommitsAllowedByApi, false);
package.json
"dependencies": {
"axios": "^1.8.3",
"azure-devops-extension-api": "^4.248.1",
"azure-devops-extension-sdk": "^4.0.2",
"azure-devops-ui": "^2.254.0",
"react": "^16.14.0",
"react-dom": "^16.14.0"
}
Work around: use the non-batch version of the function.
Metadata
Metadata
Assignees
Labels
No labels