Adds keyboard support to page in repo/file quick picks

This commit is contained in:
Eric Amodio
2017-03-13 00:15:14 -04:00
parent 3e815f6bf8
commit 3656d4e8a4
6 changed files with 113 additions and 28 deletions

View File

@@ -188,13 +188,20 @@ export class Git {
return gitCommand(root, ...params);
}
static logRepo(repoPath: string, sha?: string, maxCount?: number) {
static logRepo(repoPath: string, sha?: string, maxCount?: number, reverse: boolean = false) {
const params = [...DefaultLogParams];
if (maxCount) {
if (maxCount && !reverse) {
params.push(`-n${maxCount}`);
}
if (sha) {
params.push(sha);
if (reverse) {
params.push(`--reverse`);
params.push(`--ancestry-path`);
params.push(`${sha}..HEAD`);
}
else {
params.push(sha);
}
}
return gitCommand(repoPath, ...params);
}