@@ -11,7 +11,7 @@ public struct GitLogEntry
11
11
private const string Today = "Today" ;
12
12
private const string Yesterday = "Yesterday" ;
13
13
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 ) ;
15
15
16
16
public string commitID ;
17
17
public string mergeA ;
@@ -61,43 +61,6 @@ public GitLogEntry(string commitID,
61
61
this . mergeB = mergeB ?? string . Empty ;
62
62
}
63
63
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
-
101
64
public string PrettyTimeString
102
65
{
103
66
get
@@ -118,7 +81,15 @@ public DateTimeOffset Time
118
81
{
119
82
if ( ! timeValue . HasValue )
120
83
{
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
+ }
122
93
}
123
94
124
95
return timeValue . Value ;
@@ -137,7 +108,15 @@ public DateTimeOffset CommitTime
137
108
{
138
109
if ( ! commitTimeValue . HasValue )
139
110
{
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
+ }
141
120
}
142
121
143
122
return commitTimeValue . Value ;
0 commit comments