File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,25 @@ var Commit = function(obj) {
3232 }
3333 this . header = this . raw . substring ( 0 , messageStart ) ;
3434
35- var match = this . header . match ( / \n a u t h o r ( .* ) < ( .* @ .* | .* ) > ( [ 0 - 9 ] .* ) / ) ;
36- if ( ! ( match [ 2 ] . match ( / @ [ a - f 0 - 9 ] { 8 } - [ a - f 0 - 9 ] { 4 } - [ a - f 0 - 9 ] { 4 } - [ a - f 0 - 9 ] { 4 } - [ a - f 0 - 9 ] { 12 } / ) ) )
37- this . author_email = match [ 2 ] ;
35+ if ( typeof this . header !== 'undefined' ) {
36+ var match = this . header . match ( / \n a u t h o r ( .* ) < ( .* @ .* | .* ) > ( [ 0 - 9 ] .* ) / ) ;
37+ if ( typeof match !== 'undefined' && typeof match [ 2 ] !== 'undefined' ) {
38+ if ( ! ( match [ 2 ] . match ( / @ [ a - f 0 - 9 ] { 8 } - [ a - f 0 - 9 ] { 4 } - [ a - f 0 - 9 ] { 4 } - [ a - f 0 - 9 ] { 4 } - [ a - f 0 - 9 ] { 12 } / ) ) )
39+ this . author_email = match [ 2 ] ;
40+
41+ this . author_date = new Date ( parseInt ( match [ 3 ] ) * 1000 ) ;
42+
43+ match = this . header . match ( / \n c o m m i t t e r ( .* ) < ( .* @ .* | .* ) > ( [ 0 - 9 ] .* ) / ) ;
44+ if ( typeof match !== 'undefined' ) {
45+ this . committer_name = match [ 1 ] ;
46+ this . committer_email = match [ 2 ] ;
47+ } else {
48+ this . committer_name = "undefined" ;
49+ this . committer_email = "undefined" ;
50+ }
51+ }
52+ }
3853
39- this . author_date = new Date ( parseInt ( match [ 3 ] ) * 1000 ) ;
40-
41- match = this . header . match ( / \n c o m m i t t e r ( .* ) < ( .* @ .* | .* ) > ( [ 0 - 9 ] .* ) / ) ;
42- this . committer_name = match [ 1 ] ;
43- this . committer_email = match [ 2 ] ;
4454 this . committer_date = new Date ( parseInt ( match [ 3 ] ) * 1000 ) ;
4555 }
4656
You can’t perform that action at this time.
0 commit comments