@@ -164,6 +164,15 @@ public void CanEnumerateCommitsWithReverseTopoSorting()
164
164
}
165
165
}
166
166
167
+ [ Test ]
168
+ public void CanGetParentsCount ( )
169
+ {
170
+ using ( var repo = new Repository ( BareTestRepoPath ) )
171
+ {
172
+ repo . Commits . First ( ) . ParentsCount . ShouldEqual ( 1 ) ;
173
+ }
174
+ }
175
+
167
176
[ Test ]
168
177
public void CanEnumerateCommitsWithTimeSorting ( )
169
178
{
@@ -378,7 +387,7 @@ public void CanReadCommitData()
378
387
379
388
commit . Tree . Sha . ShouldEqual ( "181037049a54a1eb5fab404658a3a250b44335d7" ) ;
380
389
381
- commit . Parents . Count ( ) . ShouldEqual ( 0 ) ;
390
+ commit . ParentsCount . ShouldEqual ( 0 ) ;
382
391
}
383
392
}
384
393
@@ -389,6 +398,7 @@ public void CanReadCommitWithMultipleParents()
389
398
{
390
399
var commit = repo . Lookup < Commit > ( "a4a7dce85cf63874e984719f4fdd239f5145052f" ) ;
391
400
commit . Parents . Count ( ) . ShouldEqual ( 2 ) ;
401
+ commit . ParentsCount . ShouldEqual ( 2 ) ;
392
402
}
393
403
}
394
404
@@ -493,7 +503,7 @@ public void CanCommitALittleBit()
493
503
AssertBlobContent ( repo . Head [ relativeFilepath ] , "nulltoken\n " ) ;
494
504
AssertBlobContent ( commit [ relativeFilepath ] , "nulltoken\n " ) ;
495
505
496
- commit . Parents . Count ( ) . ShouldEqual ( 0 ) ;
506
+ commit . ParentsCount . ShouldEqual ( 0 ) ;
497
507
repo . Info . IsEmpty . ShouldBeFalse ( ) ;
498
508
499
509
File . WriteAllText ( filePath , "nulltoken commits!\n " ) ;
@@ -505,7 +515,7 @@ public void CanCommitALittleBit()
505
515
AssertBlobContent ( repo . Head [ relativeFilepath ] , "nulltoken commits!\n " ) ;
506
516
AssertBlobContent ( commit2 [ relativeFilepath ] , "nulltoken commits!\n " ) ;
507
517
508
- commit2 . Parents . Count ( ) . ShouldEqual ( 1 ) ;
518
+ commit2 . ParentsCount . ShouldEqual ( 1 ) ;
509
519
commit2 . Parents . First ( ) . Id . ShouldEqual ( commit . Id ) ;
510
520
511
521
Branch firstCommitBranch = repo . CreateBranch ( "davidfowl-rules" , commit . Id . Sha ) ; //TODO: This cries for a shortcut method :-/
@@ -521,7 +531,7 @@ public void CanCommitALittleBit()
521
531
AssertBlobContent ( repo . Head [ relativeFilepath ] , "davidfowl commits!\n " ) ;
522
532
AssertBlobContent ( commit3 [ relativeFilepath ] , "davidfowl commits!\n " ) ;
523
533
524
- commit3 . Parents . Count ( ) . ShouldEqual ( 1 ) ;
534
+ commit3 . ParentsCount . ShouldEqual ( 1 ) ;
525
535
commit3 . Parents . First ( ) . Id . ShouldEqual ( commit . Id ) ;
526
536
527
537
AssertBlobContent ( firstCommitBranch [ relativeFilepath ] , "nulltoken\n " ) ;
@@ -580,7 +590,7 @@ public void CanAmendARootCommit()
580
590
repo . Head . Commits . Count ( ) . ShouldEqual ( 1 ) ;
581
591
582
592
Commit originalCommit = repo . Head . Tip ;
583
- originalCommit . Parents . Count ( ) . ShouldEqual ( 0 ) ;
593
+ originalCommit . ParentsCount . ShouldEqual ( 0 ) ;
584
594
585
595
CreateAndStageANewFile ( repo ) ;
586
596
@@ -600,7 +610,7 @@ public void CanAmendACommitWithMoreThanOneParent()
600
610
{
601
611
var mergedCommit = repo . Lookup < Commit > ( "be3563a" ) ;
602
612
mergedCommit . ShouldNotBeNull ( ) ;
603
- mergedCommit . Parents . Count ( ) . ShouldEqual ( 2 ) ;
613
+ mergedCommit . ParentsCount . ShouldEqual ( 2 ) ;
604
614
605
615
repo . Reset ( ResetOptions . Soft , mergedCommit . Sha ) ;
606
616
0 commit comments