From 33debb6bb2bc550e7d99879db800c1a8ba24a340 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 22 Mar 2017 00:55:58 -0400 Subject: [PATCH] Fixes parsing issue with commits with no files --- src/git/parsers/logParser.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/git/parsers/logParser.ts b/src/git/parsers/logParser.ts index 567c246..bd4b973 100644 --- a/src/git/parsers/logParser.ts +++ b/src/git/parsers/logParser.ts @@ -11,10 +11,10 @@ interface ILogEntry { author?: string; authorDate?: string; - // committer?: string; - // committerDate?: string; + // committer?: string; + // committerDate?: string; - // parentSha?: string; + // parentSha?: string; fileName?: string; originalFileName?: string; @@ -86,6 +86,10 @@ export class GitLogParser { case 'filename': if (isRepoPath) { + const nextLine = lines[position + 1]; + // If the next line isn't blank, make sure it isn't starting a new commit + if (nextLine && Git.shaRegex.test(nextLine)) continue; + position++; let diff = false;