@@ -333,7 +333,7 @@ function sanitizePath(path: string): string {
333333 return path . replace ( / ^ ( [ a - z ] ) : \\ / i, ( _ , letter ) => `${ letter . toUpperCase ( ) } :\\` ) ;
334334}
335335
336- const COMMIT_FORMAT = '%H%n%aN%n%aE%n%at%n%P%n%B' ;
336+ const COMMIT_FORMAT = '%H%n%aN%n%aE%n%at%n%ct%n% P%n%B' ;
337337
338338export class Git {
339339
@@ -525,6 +525,7 @@ export interface Commit {
525525 authorDate ?: Date ;
526526 authorName ?: string ;
527527 authorEmail ?: string ;
528+ commitDate ?: Date ;
528529}
529530
530531export class GitStatusParser {
@@ -655,15 +656,16 @@ export function parseGitmodules(raw: string): Submodule[] {
655656 return result ;
656657}
657658
658- const commitRegex = / ( [ 0 - 9 a - f ] { 40 } ) \n ( .* ) \n ( .* ) \n ( .* ) \n ( .* ) (?: \n ( [ ^ ] * ?) ) ? (?: \x00 ) / gm;
659+ const commitRegex = / ( [ 0 - 9 a - f ] { 40 } ) \n ( .* ) \n ( .* ) \n ( .* ) \n ( .* ) \n ( . * ) (?: \n ( [ ^ ] * ?) ) ? (?: \x00 ) / gm;
659660
660661export function parseGitCommits ( data : string ) : Commit [ ] {
661662 let commits : Commit [ ] = [ ] ;
662663
663664 let ref ;
664- let name ;
665- let email ;
666- let date ;
665+ let authorName ;
666+ let authorEmail ;
667+ let authorDate ;
668+ let commitDate ;
667669 let parents ;
668670 let message ;
669671 let match ;
@@ -674,7 +676,7 @@ export function parseGitCommits(data: string): Commit[] {
674676 break ;
675677 }
676678
677- [ , ref , name , email , date , parents , message ] = match ;
679+ [ , ref , authorName , authorEmail , authorDate , commitDate , parents , message ] = match ;
678680
679681 if ( message [ message . length - 1 ] === '\n' ) {
680682 message = message . substr ( 0 , message . length - 1 ) ;
@@ -685,9 +687,10 @@ export function parseGitCommits(data: string): Commit[] {
685687 hash : ` ${ ref } ` . substr ( 1 ) ,
686688 message : ` ${ message } ` . substr ( 1 ) ,
687689 parents : parents ? parents . split ( ' ' ) : [ ] ,
688- authorDate : new Date ( Number ( date ) * 1000 ) ,
689- authorName : ` ${ name } ` . substr ( 1 ) ,
690- authorEmail : ` ${ email } ` . substr ( 1 )
690+ authorDate : new Date ( Number ( authorDate ) * 1000 ) ,
691+ authorName : ` ${ authorName } ` . substr ( 1 ) ,
692+ authorEmail : ` ${ authorEmail } ` . substr ( 1 ) ,
693+ commitDate : new Date ( Number ( commitDate ) * 1000 ) ,
691694 } ) ;
692695 } while ( true ) ;
693696
0 commit comments