diff --git a/CHANGELOG.md b/CHANGELOG.md index 6471460..411330b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Fixes [#228](https://github.com/eamodio/vscode-gitlens/issues/228) - Gutter blame spills over heatmap - Fixes incorrect blame highlighting -- thanks to [PR #231](https://github.com/eamodio/vscode-gitlens/pull/231) by Alexey Vasyukov ([@notmedia](https://github.com/notmedia))! - Fixes issue with the `Open in File/Revision` option in the file history quick pick menu +- Fixes issues with Git warnings when parsing log status output (can cause the `GitLens` view to not show data in some cases) ## [6.4.0] - 2017-12-12 ### Added diff --git a/src/git/models/status.ts b/src/git/models/status.ts index c196e97..23ebe64 100644 --- a/src/git/models/status.ts +++ b/src/git/models/status.ts @@ -132,5 +132,5 @@ const statusIconsMap = { }; export function getGitStatusIcon(status: GitStatusFileStatus): string { - return statusIconsMap[status]; + return statusIconsMap[status] || statusIconsMap['X']; } \ No newline at end of file diff --git a/src/git/parsers/logParser.ts b/src/git/parsers/logParser.ts index d927e7b..8a67022 100644 --- a/src/git/parsers/logParser.ts +++ b/src/git/parsers/logParser.ts @@ -121,8 +121,8 @@ export class GitLogParser { line = next.value; - // If the next line isn't blank, make sure it isn't starting a new commit - if (line && Git.shaRegex.test(line)) { + // If the next line isn't blank, make sure it isn't starting a new commit or s git warning + if (line && (Git.shaRegex.test(line) || line.startsWith('warning:'))) { skip = true; continue; } @@ -135,7 +135,8 @@ export class GitLogParser { line = next.value; lineParts = line.split(' '); - if (Git.shaRegex.test(lineParts[0])) { + // make sure the line isn't starting a new commit or s git warning + if (Git.shaRegex.test(lineParts[0]) || line.startsWith('warning:')) { skip = true; break; } @@ -182,9 +183,11 @@ export class GitLogParser { line = next.value; - entry.status = line[0] as GitStatusFileStatus; - entry.fileName = line.substring(1); - this.parseFileName(entry); + if (line !== undefined && !line.startsWith('warning:')) { + entry.status = line[0] as GitStatusFileStatus; + entry.fileName = line.substring(1); + this.parseFileName(entry); + } } if (first && repoPath === undefined && type === GitCommitType.File && fileName !== undefined) {