File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,38 @@ public class PullRequestCommit
15
15
{
16
16
public string Sha { get ; private set ; }
17
17
public string Url { get ; private set ; }
18
+
19
+ /// <summary>
20
+ /// Github User, may be null if unbeknown to Github
21
+ /// </summary>
18
22
public User Author { get ; private set ; }
19
23
public User Committer { get ; private set ; }
20
24
public List < Ref > Parents { get ; private set ; }
21
25
public Commit Commit { get ; private set ; }
26
+
27
+ public string AuthorName { get { return Author == null ? Commit . Author . ToString ( ) : Author . Login ; } }
22
28
}
23
29
24
30
public class CommitAuthor
25
31
{
26
32
public string Name { get ; private set ; }
27
33
public string Email { get ; private set ; }
28
34
public DateTime Date { get ; private set ; }
35
+
36
+ public override string ToString ( )
37
+ {
38
+ if ( Name != null )
39
+ {
40
+ if ( Email != null )
41
+ return string . Format ( "{0} <{1}>" , Name , Email ) ;
42
+ else
43
+ return Name ;
44
+ }
45
+ else if ( Email != null )
46
+ return Email ;
47
+ else
48
+ return "" ;
49
+ }
29
50
}
30
51
31
52
// Not too sure this is the same for normal commits.
You can’t perform that action at this time.
0 commit comments