@@ -395,8 +395,8 @@ public void CanHandleTwoTreeEntryChangesWithTheSamePath()
395
395
396
396
using ( Repository repo = Repository . Init ( scd . DirectoryPath ) )
397
397
{
398
- Blob mainContent = CreateBlob ( repo , "awesome content\n " ) ;
399
- Blob linkContent = CreateBlob ( repo , "../../objc/Nu.h" ) ;
398
+ Blob mainContent = OdbHelper . CreateBlob ( repo , "awesome content\n " ) ;
399
+ Blob linkContent = OdbHelper . CreateBlob ( repo , "../../objc/Nu.h" ) ;
400
400
401
401
string path = string . Format ( "include{0}Nu{0}Nu.h" , Path . DirectorySeparatorChar ) ;
402
402
@@ -451,15 +451,6 @@ public void CanHandleTwoTreeEntryChangesWithTheSamePath()
451
451
}
452
452
}
453
453
454
- private static Blob CreateBlob ( Repository repo , string content )
455
- {
456
- using ( var stream = new MemoryStream ( Encoding . UTF8 . GetBytes ( content ) ) )
457
- using ( var binReader = new BinaryReader ( stream ) )
458
- {
459
- return repo . ObjectDatabase . CreateBlob ( binReader ) ;
460
- }
461
- }
462
-
463
454
[ Fact ]
464
455
public void CanCompareATreeAgainstANullTree ( )
465
456
{
@@ -558,5 +549,38 @@ private RepositoryOptions BuildFakeSystemConfigFilemodeOption(
558
549
559
550
return options ;
560
551
}
552
+
553
+ [ Fact ]
554
+ public void RetrievingDiffChangesMustAlwaysBeCaseSensitive ( )
555
+ {
556
+ SelfCleaningDirectory scd = BuildSelfCleaningDirectory ( ) ;
557
+ ObjectId treeOldOid , treeNewOid ;
558
+
559
+ using ( Repository repo = Repository . Init ( scd . DirectoryPath ) )
560
+ {
561
+ Blob oldContent = OdbHelper . CreateBlob ( repo , "awesome content\n " ) ;
562
+ Blob newContent = OdbHelper . CreateBlob ( repo , "more awesome content\n " ) ;
563
+
564
+ var td = new TreeDefinition ( )
565
+ . Add ( "A.TXT" , oldContent , Mode . NonExecutableFile )
566
+ . Add ( "a.txt" , oldContent , Mode . NonExecutableFile ) ;
567
+
568
+ treeOldOid = repo . ObjectDatabase . CreateTree ( td ) . Id ;
569
+
570
+ td = new TreeDefinition ( )
571
+ . Add ( "A.TXT" , newContent , Mode . NonExecutableFile )
572
+ . Add ( "a.txt" , newContent , Mode . NonExecutableFile ) ;
573
+
574
+ treeNewOid = repo . ObjectDatabase . CreateTree ( td ) . Id ;
575
+ }
576
+
577
+ using ( var repo = new Repository ( scd . DirectoryPath ) )
578
+ {
579
+ var changes = repo . Diff . Compare ( repo . Lookup < Tree > ( treeOldOid ) , repo . Lookup < Tree > ( treeNewOid ) ) ;
580
+
581
+ Assert . Equal ( ChangeKind . Modified , changes [ "a.txt" ] . Status ) ;
582
+ Assert . Equal ( ChangeKind . Modified , changes [ "A.TXT" ] . Status ) ;
583
+ }
584
+ }
561
585
}
562
586
}
0 commit comments