mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-15 09:35:42 -05:00
Adds keyboard support to page in repo/file quick picks
This commit is contained in:
@@ -152,7 +152,7 @@ export class GitLogParserEnricher implements IGitEnricher<IGitLog> {
|
||||
return entries;
|
||||
}
|
||||
|
||||
enrich(data: string, type: GitLogType, fileNameOrRepoPath: string, maxCount: number | undefined, isRepoPath: boolean = false): IGitLog {
|
||||
enrich(data: string, type: GitLogType, fileNameOrRepoPath: string, maxCount: number | undefined, isRepoPath: boolean, reverse: boolean): IGitLog {
|
||||
const entries = this._parseEntries(data, isRepoPath);
|
||||
if (!entries) return undefined;
|
||||
|
||||
@@ -168,6 +168,9 @@ export class GitLogParserEnricher implements IGitEnricher<IGitLog> {
|
||||
}
|
||||
|
||||
for (let i = 0, len = entries.length; i < len; i++) {
|
||||
// Since log --reverse doesn't properly honor a max count -- enforce it here
|
||||
if (reverse && i >= maxCount) break;
|
||||
|
||||
const entry = entries[i];
|
||||
|
||||
if (i === 0 || isRepoPath) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user