Adds search commits command

Search by message, author, file pattern, or sha
This commit is contained in:
Eric Amodio
2017-04-09 00:01:57 -04:00
parent 7cb1b9d0f1
commit a7dc29a9aa
9 changed files with 193 additions and 2 deletions

View File

@@ -235,6 +235,15 @@ export class Git {
return gitCommand(root, ...params);
}
static log_search(repoPath: string, search?: string[], maxCount?: number) {
const params = [...defaultLogParams, `-m`, `-i`];
if (maxCount) {
params.push(`-n${maxCount}`);
}
return gitCommand(repoPath, ...params, ...search);
}
static async ls_files(repoPath: string, fileName: string): Promise<string> {
try {
return await gitCommand(repoPath, 'ls-files', fileName);