未验证 提交 3da22e92 编写于 作者: A Alex Ross 提交者: GitHub

Add path to LogOptions (#97693)

Part of microsoft/vscode-pull-request-github#1781
上级 640b3d10
......@@ -121,6 +121,7 @@ export interface RepositoryUIState {
export interface LogOptions {
/** Max number of log entries to retrieve. If not specified, the default is 32. */
readonly maxEntries?: number;
readonly path?: string;
}
export interface CommitOptions {
......
......@@ -848,6 +848,9 @@ export class Repository {
async log(options?: LogOptions): Promise<Commit[]> {
const maxEntries = options?.maxEntries ?? 32;
const args = ['log', `-n${maxEntries}`, `--format=${COMMIT_FORMAT}`, '-z', '--'];
if (options?.path) {
args.push(options.path);
}
const result = await this.run(args);
if (result.exitCode) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册