Browse Source

Fixes hasMore being wrong on an edge

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

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

@ -689,7 +689,7 @@ export namespace Git {
'-m',
];
if (limit && !reverse) {
params.push(`-n${limit}`);
params.push(`-n${limit + 1}`);
}
if (!merges) {
@ -752,7 +752,7 @@ export namespace Git {
];
if (limit && !reverse) {
params.push(`-n${limit}`);
params.push(`-n${limit + 1}`);
}
if (skip) {
@ -867,7 +867,7 @@ export namespace Git {
'--use-mailmap',
];
if (limit && !useShow) {
params.push(`-n${limit}`);
params.push(`-n${limit + 1}`);
}
if (skip && !useShow) {
params.push(`--skip=${skip}`);

+ 3
- 2
src/git/parsers/logParser.ts View File

@ -120,7 +120,7 @@ export class GitLogParser {
let renamedFileName;
let renamedMatch;
while (true) {
loop: while (true) {
next = lines.next();
if (next.done) break;
@ -347,6 +347,7 @@ export class GitLogParser {
const commit = commits.get(entry.ref!);
if (commit === undefined) {
i++;
if (limit && i > limit) break loop;
} else if (truncationCount) {
// Since this matches an existing commit it will be skipped, so reduce our truncationCount to ensure accurate truncation detection
truncationCount--;
@ -377,7 +378,7 @@ export class GitLogParser {
count: i,
limit: limit,
range: range,
hasMore: Boolean(truncationCount && i >= truncationCount && truncationCount !== 1),
hasMore: Boolean(truncationCount && i > truncationCount && truncationCount !== 1),
};
return log;
}

Loading…
Cancel
Save