Parcourir la source

Fixes issues with warnings when parsing log status

main
Eric Amodio il y a 7 ans
Parent
révision
3a90aad3bc
3 fichiers modifiés avec 11 ajouts et 7 suppressions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      src/git/models/status.ts
  3. +9
    -6
      src/git/parsers/logParser.ts

+ 1
- 0
CHANGELOG.md Voir le fichier

@ -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

+ 1
- 1
src/git/models/status.ts Voir le fichier

@ -132,5 +132,5 @@ const statusIconsMap = {
};
export function getGitStatusIcon(status: GitStatusFileStatus): string {
return statusIconsMap[status];
return statusIconsMap[status] || statusIconsMap['X'];
}

+ 9
- 6
src/git/parsers/logParser.ts Voir le fichier

@ -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) {

Chargement…
Annuler
Enregistrer