Git - add the capability to filter git log based on the author (#207169)

This commit is contained in:
Ladislau Szomoru 2024-03-08 16:41:40 +01:00 committed by GitHub
parent a9ab31da9c
commit 967170aa0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -143,6 +143,7 @@ export interface LogOptions {
readonly reverse?: boolean; readonly reverse?: boolean;
readonly sortByAuthorDate?: boolean; readonly sortByAuthorDate?: boolean;
readonly shortStats?: boolean; readonly shortStats?: boolean;
readonly author?: string;
} }
export interface CommitOptions { export interface CommitOptions {

View file

@ -1161,6 +1161,10 @@ export class Repository {
args.push(`-n${options?.maxEntries ?? 32}`); args.push(`-n${options?.maxEntries ?? 32}`);
} }
if (options?.author) {
args.push(`--author="${options.author}"`);
}
if (options?.path) { if (options?.path) {
args.push('--', options.path); args.push('--', options.path);
} }