@@ -11,7 +11,7 @@ public struct GitLogEntry
1111 private const string Today = "Today" ;
1212 private const string Yesterday = "Yesterday" ;
1313
14- public static GitLogEntry Default = new GitLogEntry ( String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , new List < GitStatusEntry > ( ) , String . Empty , String . Empty ) ;
14+ public static GitLogEntry Default = new GitLogEntry ( String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , String . Empty , DateTimeOffset . MinValue , DateTimeOffset . MinValue , new List < GitStatusEntry > ( ) , String . Empty , String . Empty ) ;
1515
1616 public string commitID ;
1717 public string mergeA ;
@@ -61,43 +61,6 @@ public GitLogEntry(string commitID,
6161 this . mergeB = mergeB ?? string . Empty ;
6262 }
6363
64- public GitLogEntry ( string commitID ,
65- string authorName , string authorEmail ,
66- string commitName , string commitEmail ,
67- string summary ,
68- string description ,
69- string timeString , string commitTimeString ,
70- List < GitStatusEntry > changes ,
71- string mergeA = null , string mergeB = null ) : this ( )
72- {
73- Guard . ArgumentNotNull ( commitID , "commitID" ) ;
74- Guard . ArgumentNotNull ( authorName , "authorName" ) ;
75- Guard . ArgumentNotNull ( authorEmail , "authorEmail" ) ;
76- Guard . ArgumentNotNull ( commitEmail , "commitEmail" ) ;
77- Guard . ArgumentNotNull ( commitName , "commitName" ) ;
78- Guard . ArgumentNotNull ( summary , "summary" ) ;
79- Guard . ArgumentNotNull ( description , "description" ) ;
80- Guard . ArgumentNotNull ( timeString , "timeString" ) ;
81- Guard . ArgumentNotNull ( commitTimeString , "commitTimeString" ) ;
82- Guard . ArgumentNotNull ( changes , "changes" ) ;
83-
84- this . commitID = commitID ;
85- this . authorName = authorName ;
86- this . authorEmail = authorEmail ;
87- this . commitEmail = commitEmail ;
88- this . commitName = commitName ;
89- this . summary = summary ;
90- this . description = description ;
91-
92- this . timeString = timeString ;
93- this . commitTimeString = commitTimeString ;
94-
95- this . changes = changes ;
96-
97- this . mergeA = mergeA ?? string . Empty ;
98- this . mergeB = mergeB ?? string . Empty ;
99- }
100-
10164 public string PrettyTimeString
10265 {
10366 get
@@ -118,7 +81,15 @@ public DateTimeOffset Time
11881 {
11982 if ( ! timeValue . HasValue )
12083 {
121- timeValue = DateTimeOffset . ParseExact ( TimeString , Constants . Iso8601Format , CultureInfo . InvariantCulture , DateTimeStyles . None ) ;
84+ DateTimeOffset result ;
85+ if ( DateTimeOffset . TryParseExact ( TimeString , Constants . Iso8601Format , CultureInfo . InvariantCulture , DateTimeStyles . None , out result ) )
86+ {
87+ timeValue = result ;
88+ }
89+ else
90+ {
91+ Time = DateTimeOffset . MinValue ;
92+ }
12293 }
12394
12495 return timeValue . Value ;
@@ -137,7 +108,15 @@ public DateTimeOffset CommitTime
137108 {
138109 if ( ! commitTimeValue . HasValue )
139110 {
140- commitTimeValue = DateTimeOffset . ParseExact ( CommitTimeString , Constants . Iso8601Format , CultureInfo . InvariantCulture , DateTimeStyles . None ) ;
111+ DateTimeOffset result ;
112+ if ( DateTimeOffset . TryParseExact ( CommitTimeString , Constants . Iso8601Format , CultureInfo . InvariantCulture , DateTimeStyles . None , out result ) )
113+ {
114+ commitTimeValue = result ;
115+ }
116+ else
117+ {
118+ CommitTime = DateTimeOffset . MinValue ;
119+ }
141120 }
142121
143122 return commitTimeValue . Value ;
0 commit comments