Skip to content

Commit

Permalink
Changes authors filtering to allow multiple authors
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Dec 13, 2018
1 parent 99bf1c5 commit a5a77f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/git/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,10 @@ export class Git {
return git<string>({ 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}`);
Expand Down
4 changes: 2 additions & 2 deletions src/git/gitService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GitLog | undefined> {
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
Expand Down

0 comments on commit a5a77f1

Please sign in to comment.