@@ -18,6 +18,12 @@ public class CommitLog : IQueryableCommitLog
18
18
private IList < object > excludedIdentifier = new List < object > ( ) ;
19
19
private readonly GitSortOptions sortOptions ;
20
20
21
+ /// <summary>
22
+ /// Needed for mocking purposes.
23
+ /// </summary>
24
+ protected CommitLog ( )
25
+ { }
26
+
21
27
/// <summary>
22
28
/// Initializes a new instance of the <see cref = "CommitLog" /> class.
23
29
/// The commits will be enumerated according in reverse chronological order.
@@ -42,7 +48,7 @@ internal CommitLog(Repository repo, GitSortOptions sortingStrategy)
42
48
/// <summary>
43
49
/// Gets the current sorting strategy applied when enumerating the log
44
50
/// </summary>
45
- public GitSortOptions SortedBy
51
+ public virtual GitSortOptions SortedBy
46
52
{
47
53
get { return sortOptions ; }
48
54
}
@@ -53,7 +59,7 @@ public GitSortOptions SortedBy
53
59
/// Returns an enumerator that iterates through the log.
54
60
/// </summary>
55
61
/// <returns>An <see cref = "IEnumerator{T}" /> object that can be used to iterate through the log.</returns>
56
- public IEnumerator < Commit > GetEnumerator ( )
62
+ public virtual IEnumerator < Commit > GetEnumerator ( )
57
63
{
58
64
if ( ( repo . Info . IsEmpty ) & & includedIdentifier . Any ( o => PointsAtTheHead ( o . ToString ( ) ) ) ) // TODO: ToString() == fragile
59
65
{
@@ -79,7 +85,7 @@ IEnumerator IEnumerable.GetEnumerator()
79
85
/// </summary>
80
86
/// <param name = "filter">The options used to control which commits will be returned.</param>
81
87
/// <returns>A list of commits, ready to be enumerated.</returns>
82
- public ICommitLog QueryBy ( Filter filter )
88
+ public virtual ICommitLog QueryBy ( Filter filter )
83
89
{
84
90
Ensure . ArgumentNotNull ( filter , "filter" ) ;
85
91
Ensure . ArgumentNotNull ( filter . Since , "filter.Since" ) ;
@@ -130,7 +136,7 @@ private static bool PointsAtTheHead(string shaOrRefName)
130
136
/// <param name = "first">The first <see cref = "Commit"/>.</param>
131
137
/// <param name = "second">The second <see cref = "Commit"/>.</param>
132
138
/// <returns>The common ancestor or null if none found.</returns>
133
- public Commit FindCommonAncestor ( Commit first , Commit second )
139
+ public virtual Commit FindCommonAncestor ( Commit first , Commit second )
134
140
{
135
141
Ensure . ArgumentNotNull ( first , "first" ) ;
136
142
Ensure . ArgumentNotNull ( second , "second" ) ;
@@ -157,7 +163,7 @@ public Commit FindCommonAncestor(Commit first, Commit second)
157
163
/// </summary>
158
164
/// <param name = "commits">The <see cref = "Commit"/>s for which to find the common ancestor.</param>
159
165
/// <returns>The common ancestor or null if none found.</returns>
160
- public Commit FindCommonAncestor ( IEnumerable < Commit > commits )
166
+ public virtual Commit FindCommonAncestor ( IEnumerable < Commit > commits )
161
167
{
162
168
Ensure . ArgumentNotNull ( commits , "commits" ) ;
163
169
Commit ret = null ;
0 commit comments