【发布时间】:2018-08-03 12:15:14
【问题描述】:
我一直在使用vsts-node-api 并取得了一定程度的成功。
但是,我想要查询特定分支中的所有提交。这在 here 找到的 REST api 文档中有所描述。
但是节点 api 只允许您使用 GitApi 的这种方法查询存储库中的提交
getCommits(repositoryId: string, searchCriteria: GitInterfaces.GitQueryCommitsCriteria, project?: string, skip?: number, top?: number): Promise<GitInterfaces.GitCommitRef[]>;
GitInterfaces.GitQueryCommitsCriteria有这个接口
export interface GitQueryCommitsCriteria {
$skip: number;
$top: number;
author: string;
compareVersion: GitVersionDescriptor;
excludeDeletes: boolean;
fromCommitId: string;
fromDate: string;
historyMode: GitHistoryMode;
ids: string[];
includeLinks: boolean;
includeWorkItems: boolean;
itemPath: string;
itemVersion: GitVersionDescriptor;
toCommitId: string;
toDate: string;
user: string;
}
如您所见,getCommits 没有分支参数,Query 接口也没有,所以我对如何做到这一点有点困惑。
为了提供一些上下文,我想要实现的是,当更新或创建 PR 时,我想检查 pr 的源分支是否包含目标分支的最新提交,以确认源分支已启动到目标分支为止。
【问题讨论】:
-
看起来像是客户端生成中的错误。我在内部提出了一个错误。
标签: node.js git typescript azure-devops azure-devops-rest-api