Browse Source

Fixes git log paging with merge commits

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

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

@ -724,13 +724,14 @@ export namespace Git {
`--format=${GitLogParser.defaultFormat}`, `--format=${GitLogParser.defaultFormat}`,
'--full-history', '--full-history',
`-M${similarityThreshold == null ? '' : `${similarityThreshold}%`}`, `-M${similarityThreshold == null ? '' : `${similarityThreshold}%`}`,
'-m',
]; ];
if (limit && !reverse) { if (limit && !reverse) {
params.push(`-n${limit}`); params.push(`-n${limit}`);
} }
if (merges) {
params.push('-m');
if (!merges) {
params.push('--first-parent');
} }
if (authors) { if (authors) {

+ 8
- 1
src/git/parsers/logParser.ts View File

@ -178,7 +178,14 @@ export class GitLogParser {
// 'f': // files // 'f': // files
// Skip the blank line git adds before the files // Skip the blank line git adds before the files
next = lines.next(); next = lines.next();
if (next.done || next.value === '</f>') break;
if (next.done || next.value === '</f>') {
// If there are no files returned, we end up skipping the commit, so reduce our truncationCount to ensure accurate truncation detection
if (truncationCount) {
truncationCount--;
}
break;
}
while (true) { while (true) {
next = lines.next(); next = lines.next();

Loading…
Cancel
Save