diff --git a/src/git/parsers/logParser.ts b/src/git/parsers/logParser.ts index 25c9a94..184ebb3 100644 --- a/src/git/parsers/logParser.ts +++ b/src/git/parsers/logParser.ts @@ -124,8 +124,8 @@ export class GitLogParser { } } - if (entry.summary !== undefined) { - // Remove the trailing newline + // Remove the trailing newline + if (entry.summary != null && entry.summary.charCodeAt(entry.summary.length - 1) === 10) { entry.summary = entry.summary.slice(0, -1); } break; diff --git a/src/git/parsers/stashParser.ts b/src/git/parsers/stashParser.ts index efc03e8..f2d9870 100644 --- a/src/git/parsers/stashParser.ts +++ b/src/git/parsers/stashParser.ts @@ -79,8 +79,8 @@ export class GitStashParser { } } - if (entry.summary !== undefined) { - // Remove the trailing newline + // Remove the trailing newline + if (entry.summary != null && entry.summary.charCodeAt(entry.summary.length - 1) === 10) { entry.summary = entry.summary.slice(0, -1); } break; @@ -114,9 +114,8 @@ export class GitStashParser { } if (entry.files !== undefined) { - entry.fileNames = Arrays.filterMap( - entry.files, - f => (f.fileName ? f.fileName : undefined) + entry.fileNames = Arrays.filterMap(entry.files, f => + f.fileName ? f.fileName : undefined ).join(', '); } }