@@ -92,7 +92,7 @@ public void CanEnumerateCommitsFromSha()
92
92
string path = SandboxBareTestRepo ( ) ;
93
93
using ( var repo = new Repository ( path ) )
94
94
{
95
- foreach ( Commit commit in repo . Commits . QueryBy ( new CommitFilter { Since = "a4a7dce85cf63874e984719f4fdd239f5145052f" } ) )
95
+ foreach ( Commit commit in repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = "a4a7dce85cf63874e984719f4fdd239f5145052f" } ) )
96
96
{
97
97
Assert . NotNull ( commit ) ;
98
98
count ++ ;
@@ -107,9 +107,9 @@ public vo
8000
id QueryingTheCommitHistoryWithUnknownShaOrInvalidEntryPointThrows()
107
107
string path = SandboxBareTestRepo ( ) ;
108
108
using ( var repo = new Repository ( path ) )
109
109
{
110
- Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { Since = Constants . UnknownSha } ) . Count ( ) ) ;
111
- Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { Since = "refs/heads/deadbeef" } ) . Count ( ) ) ;
112
- Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { Since = null } ) . Count ( ) ) ;
110
+ Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = Constants . UnknownSha } ) . Count ( ) ) ;
111
+ Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = "refs/heads/deadbeef" } ) . Count ( ) ) ;
112
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = null } ) . Count ( ) ) ;
113
113
}
114
114
}
115
115
@@ -121,8 +121,8 @@ public void QueryingTheCommitHistoryFromACorruptedReferenceThrows()
121
121
{
122
122
CreateCorruptedDeadBeefHead ( repo . Info . Path ) ;
123
123
124
- Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { Since = repo . Branches [ "deadbeef" ] } ) . Count ( ) ) ;
125
- Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { Since = repo . Refs [ "refs/heads/deadbeef" ] } ) . Count ( ) ) ;
124
+ Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = repo . Branches [ "deadbeef" ] } ) . Count ( ) ) ;
125
+ Assert . Throws < NotFoundException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = repo . Refs [ "refs/heads/deadbeef" ] } ) . Count ( ) ) ;
126
126
}
127
127
}
128
128
@@ -132,8 +132,8 @@ public void QueryingTheCommitHistoryWithBadParamsThrows()
132
132
string path = SandboxBareTestRepo ( ) ;
133
133
using ( var repo = new Repository ( path ) )
134
134
{
135
- Assert . Throws < ArgumentException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { Since = string . Empty } ) ) ;
136
- Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { Since = null } ) ) ;
135
+ Assert . Throws < ArgumentException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = string . Empty } ) ) ;
136
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( new CommitFilter { IncludeReachableFrom = null } ) ) ;
137
137
Assert . Throws < ArgumentNullException > ( ( ) => repo . Commits . QueryBy ( default ( CommitFilter ) ) ) ;
138
138
}
139
139
}
@@ -150,7 +150,7 @@ public void CanEnumerateCommitsWithReverseTimeSorting()
150
150
{
151
151
foreach ( Commit commit in repo . Commits . QueryBy ( new CommitFilter
152
152
{
153
- Since = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
153
+ IncludeReachableFrom = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
154
154
SortBy = CommitSortStrategies . Time | CommitSortStrategies . Reverse
155
155
} ) )
156
156
{
@@ -170,7 +170,7 @@ public void CanEnumerateCommitsWithReverseTopoSorting()
170
170
{
171
171
List < Commit > commits = repo . Commits . QueryBy ( new CommitFilter
172
172
{
173
- Since = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
173
+ IncludeReachableFrom = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
174
174
SortBy = CommitSortStrategies . Time | CommitSortStrategies . Reverse
175
175
} ) . ToList ( ) ;
176
176
foreach ( Commit commit in commits )
@@ -189,7 +189,7 @@ public void CanEnumerateCommitsWithReverseTopoSorting()
189
189
public void CanSimplifyByFirstParent ( )
190
190
{
191
191
AssertEnumerationOfCommits (
192
- repo => new CommitFilter { Since = repo . Head , FirstParentOnly = true } ,
192
+ repo => new CommitFilter { IncludeReachableFrom = repo . Head , FirstParentOnly = true } ,
193
193
new [ ]
194
194
{
195
195
"4c062a6" , "be3563a" , "9fd738e" ,
@@ -216,7 +216,7 @@ public void CanEnumerateCommitsWithTimeSorting()
216
216
{
217
217
foreach ( Commit commit in repo . Commits . QueryBy ( new CommitFilter
218
218
{
219
- Since = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
219
+ IncludeReachableFrom = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
220
220
SortBy = CommitSortStrategies . Time
221
221
} ) )
222
222
{
@@ -236,7 +236,7 @@ public void CanEnumerateCommitsWithTopoSorting()
236
236
{
237
237
List < Commit > commits = repo . Commits . QueryBy ( new CommitFilter
238
238
{
239
- Since = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
239
+ IncludeReachableFrom = "a4a7dce85cf63874e984719f4fdd239f5145052f" ,
240
240
SortBy = CommitSortStrategies . Topological
241
241
} ) . ToList ( ) ;
242
242
foreach ( Commit commit in commits )
@@ -255,7 +255,7 @@ public void CanEnumerateCommitsWithTopoSorting()
255
255
public void CanEnumerateFromHead ( )
256
256
{
257
257
AssertEnumerationOfCommits (
258
- repo => new CommitFilter { Since = repo . Head } ,
258
+ repo => new CommitFilter { IncludeReachableFrom = repo . Head } ,
259
259
new [ ]
260
260
{
261
261
"4c062a6" , "be3563a" , "c47800c" , "9fd738e" ,
@@ -277,7 +277,7 @@ public void CanEnumerateFromDetachedHead()
277
277
repoClone . Checkout ( headSha ) ;
278
278
279
279
AssertEnumerationOfCommitsInRepo ( repoClone ,
280
- repo => new CommitFilter { Since = repo . Head } ,
280
+ repo => new CommitFilter { IncludeReachableFrom = repo . Head } ,
281
281
new [ ]
282
282
{
283
283
"32eab9c" , "592d3c8" , "4c062a6" ,
@@ -291,7 +291,7 @@ public void CanEnumerateFromDetachedHead()
291
291
public void CanEnumerateUsingTwoHeadsAsBoundaries ( )
292
292
{
293
293
AssertEnumerationOfCommits (
294
- repo => new CommitFilter { Since = "HEAD" , Until = "refs/heads/br2" } ,
294
+ repo => new CommitFilter { IncludeReachableFrom = "HEAD" , ExcludeReachableFrom = "refs/heads/br2" } ,
295
295
new [ ] { "4c062a6" , "be3563a" }
296
296
) ;
297
297
}
@@ -300,7 +300,7 @@ public void CanEnumerateUsingTwoHeadsAsBoundaries()
300
300
public void CanEnumerateUsingImplicitHeadAsSinceBoundary ( )
301
301
{
302
302
AssertEnumerationOfCommits (
303
- repo => new CommitFilter { Until = "refs/heads/br2" } ,
303
+ repo => new CommitFilter { ExcludeReachableFrom = "refs/heads/br2" } ,
304
304
new [ ] { "4c062a6" , "be3563a" }
305
305
) ;
306
306
}
@@ -309,7 +309,7 @@ public void CanEnumerateUsingImplicitHeadAsSinceBoundary()
309
309
public void CanEnumerateUsingTwoAbbreviatedShasAsBoundaries ( )
310
310
{
311
311
AssertEnumerationOfCommits (
312
- repo => new CommitFilter { Since = "a4a7dce" , Until = "4a202b3" } ,
312
+ repo => new CommitFilter { IncludeReachableFrom = "a4a7dce" , ExcludeReachableFrom = "4a202b3" } ,
313
313
new [ ] { "a4a7dce" , "c47800c" , "9fd738e" }
314
314
) ;
315
315
}
@@ -318,7 +318,7 @@ public void CanEnumerateUsingTwoAbbreviatedShasAsBoundaries()
318
318
public void CanEnumerateCommitsFromTwoHeads ( )
319
319
{
320
320
AssertEnumerationOfCommits (
321
- repo => new CommitFilter { Since = new [ ] { "refs/heads/br2" , "refs/heads/master" } } ,
321
+ repo => new CommitFilter { IncludeReachableFrom = new [ ] { "refs/heads/br2" , "refs/heads/master" } } ,
322
322
new [ ]
323
323
{
324
324
"4c062a6" , "a4a7dce" , "be3563a" , "c47800c" ,
@@ -330,7 +330,7 @@ public void CanEnumerateCommitsFromTwoHeads()
330
330
public void CanEnumerateCommitsFromMixedStartingPoints ( )
331
331
{
332
332
AssertEnumerationOfCommits (
333
- repo => new CommitFilter { Since = new object [ ] { repo . Branches [ "br2" ] ,
333
+ repo => new CommitFilter { IncludeReachableFrom = new object [ ] { repo . Branches [ "br2" ] ,
334
334
"refs/heads/master" ,
335
335
new ObjectId ( "e90810b8df3e80c413d903f631643c716887138d" ) } } ,
336
336
new [ ]
@@ -345,7 +345,7 @@ public void CanEnumerateCommitsFromMixedStartingPoints()
345
345
public void CanEnumerateCommitsUsingGlob ( )
346
346
{
347
347
AssertEnumerationOfCommits (
348
- repo => new CommitFilter { Since = repo . Refs . FromGlob ( "refs/heads/*" ) } ,
348
+ repo => new CommitFilter { IncludeReachableFrom = repo . Refs . FromGlob ( "refs/heads/*" ) } ,
349
349
new [ ]
350
350
{
351
351
"4c062a6" , "e90810b" , "6dcf9bf" , "a4a7dce" , "be3563a" , "c47800c" , "9fd738e" , "4a202b3" , "41bc8c6" , "5001298" , "5b5b025" , "8496071"
@@ -356,7 +356,7 @@ public void CanEnumerateCommitsUsingGlob()
356
356
public void CanHideCommitsUsingGlob ( )
357
357
{
358
358
AssertEnumerationOfCommits (
359
- repo => new CommitFilter { Since = "refs/heads/packed-test" , Until = repo . Refs . FromGlob ( "*/packed" ) } ,
359
+ repo => new CommitFilter { IncludeReachableFrom = "refs/heads/packed-test" , ExcludeReachableFrom = repo . Refs . FromGlob ( "*/packed" ) } ,
360
360
new [ ]
361
361
{
362
362
"4a202b3" , "5b5b025" , "8496071"
@@ -378,7 +378,7 @@ public void CanEnumerateCommitsFromATagAnnotation()
378
378
private void CanEnumerateCommitsFromATag ( Func < Tag , object > transformer )
379
379
{
380
380
AssertEnumerationOfCommits (
381
- repo => new CommitFilter { Since = transformer ( repo . Tags [ "test" ] ) } ,
381
+ repo => new CommitFilter { IncludeReachableFrom = transformer ( repo . Tags [ "test" ] ) } ,
382
382
new [ ] { "e90810b" , "6dcf9bf" , }
383
383
) ;
384
384
}
@@ -389,7 +389,7 @@ public void CanEnumerateAllCommits()
389
389
AssertEnumerationOfCommits (
390
390
repo => new CommitFilter
391
391
{
392
- Since = repo . Refs . OrderBy ( r => r . CanonicalName , StringComparer . Ordinal ) ,
392
+ IncludeReachableFrom = repo . Refs . OrderBy ( r => r . CanonicalName , StringComparer . Ordinal ) ,
393
393
} ,
394
394
new [ ]
395
395
{
@@ -404,7 +404,7 @@ public void CanEnumerateAllCommits()
404
404
public void CanEnumerateCommitsFromATagWhichPointsToABlob ( )
405
405
{
406
406
AssertEnumerationOfCommits (
407
- repo => new CommitFilter { Since = repo . Tags [ "point_to_blob" ] } ,
407
+ repo => new CommitFilter { IncludeReachableFrom = repo . Tags [ "point_to_blob" ] } ,
408
408
new string [ ] { } ) ;
409
409
}
410
410
@@ -419,7 +419,7 @@ public void CanEnumerateCommitsFromATagWhichPointsToATree()
419
419
Tag tag = repo . ApplyTag ( "point_to_tree" , headTreeSha ) ;
420
420
421
421
AssertEnumerationOfCommitsInRepo ( repo ,
422
- r => new CommitFilter { Since = tag } ,
422
+ r => new CommitFilter { IncludeReachableFrom = tag } ,
423
423
new string [ ] { } ) ;
424
424
}
425
425
}
@@ -880,10 +880,10 @@ public void CanRetrieveChildrenOfASpecificCommit()
880
880
var filter = new CommitFilter
881
881
{
882
882
/* Revwalk from all the refs (git log --all) ... */
883
- Since = repo . Refs ,
883
+ IncludeReachableFrom = repo . Refs ,
884
884
885
885
/* ... and stop when the parent is reached */
886
- Until = parentSha
886
+ ExcludeReachableFrom = parentSha
887
887
} ;
888
888
889
889
var commits = repo . Commits . QueryBy ( filter ) ;
0 commit comments