Browse Source

Changes authors filtering to allow multiple authors

main
Eric Amodio 6 years ago
parent
commit
a5a77f11c5
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      src/git/git.ts
  2. +2
    -2
      src/git/gitService.ts

+ 3
- 3
src/git/git.ts View File

@ -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}`);

+ 2
- 2
src/git/gitService.ts View File

@ -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

Loading…
Cancel
Save