@@ -21,10 +21,10 @@ public class Commit : GitObject
21
21
private readonly ILazy < Signature > lazyAuthor ;
22
22
private readonly ILazy < Signature > lazyCommitter ;
23
23
private readonly ILazy < string > lazyMessage ;
24
+ private readonly ILazy < string > lazyMessageShort ;
24
25
private readonly ILazy < string > lazyEncoding ;
25
26
26
27
private readonly ParentsCollection parents ;
27
- private readonly Lazy < string > lazyShortMessage ;
28
28
private readonly Lazy < IEnumerable < Note > > lazyNotes ;
29
29
30
30
/// <summary>
@@ -42,9 +42,9 @@ internal Commit(Repository repo, ObjectId id)
42
42
lazyAuthor = group . AddLazy ( Proxy . git_commit_author ) ;
43
43
lazyCommitter = group . AddLazy ( Proxy . git_commit_committer ) ;
44
44
lazyMessage = group . AddLazy ( Proxy . git_commit_message ) ;
45
+ lazyMessageShort = group . AddLazy ( Proxy . git_commit_summary ) ;
45
46
lazyEncoding = group . AddLazy ( RetrieveEncodingOf ) ;
46
47
47
- lazyShortMessage = new Lazy < string > ( ExtractShortMessage ) ;
48
48
lazyNotes = new Lazy < IEnumerable < Note > > ( ( ) => RetrieveNotesOfCommit ( id ) . ToList ( ) ) ;
49
49
50
50
parents = new ParentsCollection ( repo , id ) ;
@@ -68,7 +68,7 @@ public virtual TreeEntry this[string relativePath]
68
68
/// <summary>
69
69
/// Gets the short commit message which is usually the first line of the commit.
70
70
/// </summary>
71
- public virtual string MessageShort { get { return lazyShortMessage . Value ; } }
71
+ public virtual string MessageShort { get { return lazyMessageShort . Value ; } }
72
72
73
73
/// <summary>
74
74
/// Gets the encoding of the message.
@@ -100,16 +100,6 @@ public virtual TreeEntry this[string relativePath]
100
100
/// </summary>
101
101
public virtual IEnumerable < Note > Notes { get { return lazyNotes . Value ; } }
102
102
103
- private string ExtractShortMessage ( )
104
- {
105
- if ( Message == null )
106
- {
107
- return string . Empty ; //TODO: Add some test coverage
108
- }
109
-
110
- return Message . Split ( '\n ' ) [ 0 ] ;
111
- }
112
-
113
103
private IEnumerable < Note > RetrieveNotesOfCommit ( ObjectId oid )
114
104
{
115
105
return repo . Notes [ oid ] ;
0 commit comments