@@ -190,15 +190,18 @@ int IEqualityComparer<CompletedRebaseStepInfo>.GetHashCode(CompletedRebaseStepIn
190
190
/// <summary>
191
191
/// Verify a single rebase, but in more detail.
192
192
/// </summary>
193
- [ Fact ]
194
- public void VerifyRebaseDetailed ( )
193
+ [ Theory ]
194
+ [ InlineData ( "* text=auto" , new [ ] { "2cad6e96a0028f1764dcbde6292a9a1471acb114" , "18fd3deebe6124b5dacc8426d589d617a968e8d1" , "048977d8cb90d530e83cc615a17a49f3068f68c1" } ) ]
195
+ [ InlineData ( "* text=lf" , new [ ] { "4f813f70525a6ba4ea414a54ad89412b8d9f25aa" , "6a2261c0739058ac987f1fa0014946753161b167" , "6aa53c88fc1e739678749dff5acf4b00799b5c4d" } ) ]
196
+ [ InlineData ( "* text=crlf" , new [ ] { "28e48a7c129e1025d0233cb5a92425f12f55070b" , "d737950e62ec31a25afc34b06075e144b3d2be31" , "bf4ed0456e4a2cc42a8746191501d8521cfad6a8" } ) ]
197
+ public void VerifyRebaseDetailed ( string attributes , string [ ] expectedIds )
195
198
{
196
199
SelfCleaningDirectory scd = BuildSelfCleaningDirectory ( ) ;
197
200
var path = Repository . Init ( scd . DirectoryPath ) ;
198
201
199
202
using ( Repository repo = new Repository ( path ) )
200
203
{
201
- ConstructRebaseTestRepository ( repo ) ;
204
+ ConstructRebaseTestRepository ( repo , attributes ) ;
202
205
203
206
Branch initialBranch = repo . Branches [ topicBranch1Name ] ;
204
207
Branch upstreamBranch = repo . Branches [ masterBranch2Name ] ;
@@ -262,9 +265,9 @@ public void VerifyRebaseDetailed()
262
265
263
266
List < ObjectId > expectedTreeIds = new List < ObjectId > ( )
264
267
{
265
- new ObjectId ( "2cad6e96a0028f1764dcbde6292a9a1471acb114" ) ,
266
- new ObjectId ( "18fd3deebe6124b5dacc8426d589d617a968e8d1" ) ,
267
- new ObjectId ( "048977d8cb90d530e83cc615a17a49f3068f68c1" ) ,
268
+ new ObjectId ( expectedIds [ 0 ] ) ,
269
+ new ObjectId ( expectedIds [ 1 ] ) ,
270
+ new ObjectId ( expectedIds [ 2 ] ) ,
268
271
} ;
269
272
270
273
List < Commit > rebasedCommits = repo . Commits . QueryBy ( commitFilter ) . ToList ( ) ;
@@ -591,14 +594,17 @@ public void CurrentStepInfoIsNullWhenNotRebasing()
591
594
}
592
595
}
593
596
594
- [ Fact ]
595
- public void CanRebaseHandlePatchAlreadyApplied ( )
597
+ [ Theory ]
598
+ [ InlineData ( "* text=auto" , "379e80ed7824be7672e1e30ddd8f44aa081d57d4" ) ]
599
+ [ InlineData ( "* text=lf" , "d43f4f2cb680ea446aef98f650a391224b18d171" ) ]
600
+ [ InlineData ( "* text=crlf" , "62b1e8ddefb3a083f3c6bbda138271b878c59459" ) ]
601
+ public void CanRebaseHandlePatchAlreadyApplied ( string attributes , string expectedShaText )
596
602
{
597
603
SelfCleaningDirectory scd = BuildSelfCleaningDirectory ( ) ;
598
604
var path = Repository . Init ( scd . DirectoryPath ) ;
599
605
using ( Repository repo = new Repository ( path ) )
600
606
{
601
- ConstructRebaseTestRepository ( repo ) ;
607
+ ConstructRebaseTestRepository ( repo , attributes ) ;
602
608
603
609
repo . Checkout ( topicBranch1Name ) ;
604
610
@@ -631,7 +637,7 @@ public void CanRebaseHandlePatchAlreadyApplied()
631
637
} ;
632
638
633
639
repo . Rebase . Start ( null , upstreamBranch , null , Constants . Identity2 , options ) ;
634
- ObjectId secondCommitExpectedTreeId = new ObjectId ( "379e80ed7824be7672e1e30ddd8f44aa081d57d4" ) ;
640
+ ObjectId secondCommitExpectedTreeId = new ObjectId ( expectedShaText ) ;
635
641
Signature secondCommitAuthorSignature = Constants . Signature ;
636
642
Identity secondCommitCommiterIdentity = Constants . Identity2 ;
637
643
@@ -642,7 +648,7 @@ public void CanRebaseHandlePatchAlreadyApplied()
642
648
Assert . NotNull ( rebaseResults [ 1 ] . Commit ) ;
643
649
644
650
// This is the expected tree ID of the new commit.
645
- Assert . True ( ObjectId . Equals ( secondCommitExpectedTreeId , rebaseResults [ 1 ] . Commit . Tree . Id ) ) ;
651
+ Assert . Equal ( secondCommitExpectedTreeId , rebaseResults [ 1 ] . Commit . Tree . Id ) ;
646
652
Assert . True ( Signature . Equals ( secondCommitAuthorSignature , rebaseResults [ 1 ] . Commit . Author ) ) ;
647
653
Assert . Equal < string > ( secondCommitCommiterIdentity . Name , rebaseResults [ 1 ] . Commit . Committer . Name , StringComparer . Ordinal ) ;
648
654
Assert . Equal < string > ( secondCommitCommiterIdentity . Email , rebaseResults [ 1 ] . Commit . Committer . Email , StringComparer . Ordinal ) ;
@@ -664,7 +670,7 @@ public void RebasingInBareRepositoryThrows()
664
670
}
665
671
}
666
672
667
- private void ConstructRebaseTestRepository ( Repository repo )
673
+ private void ConstructRebaseTestRepository ( Repository repo , string attributes = "* text=auto" )
668
674
{
669
675
// Constructs a graph that looks like:
670
676
// * -- * -- * (modifications to c.txt)
@@ -700,7 +706,7 @@ private void ConstructRebaseTestRepository(Repository repo)
700
706
string workdir = repo . Info . WorkingDirectory ;
701
707
Commit commit = null ;
702
708
703
- CreateAttributesFile ( repo , "* text=auto" ) ;
709
+ CreateAttributesFile ( repo , attributes ) ;
704
710
705
711
repo . Stage ( ".gitattributes" ) ;
706
712
commit = repo . Commit ( "setup" , Constants . Signature , Constants . Signature , new CommitOptions ( ) ) ;
0 commit comments