From a5a77f11c5f1c5596d247e052bc765a1f6fdc54b Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 13 Dec 2018 00:19:16 -0500 Subject: [PATCH] Changes authors filtering to allow multiple authors --- src/git/git.ts | 6 +++--- src/git/gitService.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/git/git.ts b/src/git/git.ts index 2fbe211..ead5129 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -592,10 +592,10 @@ export class Git { return git({ cwd: repoPath }, ...params); } - static log(repoPath: string, options: { author?: string; maxCount?: number; ref?: string; reverse?: boolean }) { + static log(repoPath: string, options: { authors?: string[]; maxCount?: number; ref?: string; reverse?: boolean }) { const params = [...defaultLogParams, '--full-history', '-M', '-m']; - if (options.author) { - params.push(`--author=${options.author}`); + if (options.authors) { + params.push(...options.authors.map(a => `--author=${a}`)); } if (options.maxCount && !options.reverse) { params.push(`-n${options.maxCount}`); diff --git a/src/git/gitService.ts b/src/git/gitService.ts index defe3d4..f348436 100644 --- a/src/git/gitService.ts +++ b/src/git/gitService.ts @@ -1321,13 +1321,13 @@ export class GitService implements Disposable { @log() async getLog( repoPath: string, - options: { author?: string; maxCount?: number; ref?: string; reverse?: boolean } = {} + options: { authors?: string[]; maxCount?: number; ref?: string; reverse?: boolean } = {} ): Promise { const maxCount = options.maxCount == null ? Container.config.advanced.maxListItems || 0 : options.maxCount; try { const data = await Git.log(repoPath, { - author: options.author, + authors: options.authors, maxCount: maxCount, ref: options.ref, reverse: options.reverse