diff --git a/src/git/enrichers/blameParserEnricher.ts b/src/git/enrichers/blameParserEnricher.ts index 02f8b8d..09853c7 100644 --- a/src/git/enrichers/blameParserEnricher.ts +++ b/src/git/enrichers/blameParserEnricher.ts @@ -1,5 +1,5 @@ 'use strict'; -import { GitBlameFormat, GitCommit, IGitAuthor, IGitBlame, IGitCommitLine, IGitEnricher } from './../git'; +import Git, { GitBlameFormat, GitCommit, IGitAuthor, IGitBlame, IGitCommitLine, IGitEnricher } from './../git'; import * as moment from 'moment'; import * as path from 'path'; @@ -64,7 +64,9 @@ export class GitBlameParserEnricher implements IGitEnricher { switch (lineParts[0]) { case 'author': - entry.author = lineParts.slice(1).join(' ').trim(); + entry.author = Git.isUncommitted(entry.sha) + ? 'Uncommitted' + : lineParts.slice(1).join(' ').trim(); break; // case 'author-mail': diff --git a/src/git/enrichers/logParserEnricher.ts b/src/git/enrichers/logParserEnricher.ts index d9b67ee..e2b685f 100644 --- a/src/git/enrichers/logParserEnricher.ts +++ b/src/git/enrichers/logParserEnricher.ts @@ -1,5 +1,5 @@ 'use strict'; -import { GitCommit, IGitAuthor, IGitEnricher, IGitLog } from './../git'; +import Git, { GitCommit, IGitAuthor, IGitEnricher, IGitLog } from './../git'; import * as moment from 'moment'; import * as path from 'path'; @@ -47,7 +47,9 @@ export class GitLogParserEnricher implements IGitEnricher { switch (lineParts[0]) { case 'author': - entry.author = lineParts.slice(1).join(' ').trim(); + entry.author = Git.isUncommitted(entry.sha) + ? 'Uncommitted' + : lineParts.slice(1).join(' ').trim(); break; case 'author-date':