瀏覽代碼

Allow empty (non-merge) commits

main
Eric Amodio 4 年之前
父節點
當前提交
999f4fe63c
共有 1 個文件被更改,包括 12 次插入5 次删除
  1. +12
    -5
      src/git/parsers/logParser.ts

+ 12
- 5
src/git/parsers/logParser.ts 查看文件

@ -189,16 +189,23 @@ export class GitLogParser {
// 'f': // files
// Skip the blank line git adds before the files
next = lines.next();
let hasFiles = true;
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--;
// If this is a merge commit and there are no files returned, skip the commit and reduce our truncationCount to ensure accurate truncation detection
if ((entry.parentShas?.length ?? 0) > 1) {
if (truncationCount) {
truncationCount--;
}
break;
}
break;
hasFiles = false;
}
while (true) {
// eslint-disable-next-line no-unmodified-loop-condition
while (hasFiles) {
next = lines.next();
if (next.done) break;

Loading…
取消
儲存