File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -654,6 +654,50 @@ public void CanShortenObjectIdentifier()
654654 }
655655 }
656656
657+ [ Fact ]
658+ public void TestMergeIntoSelfHasNoConflicts ( )
659+ {
660+ string path = SandboxMergeTestRepo ( ) ;
661+ using ( var repo = new Repository ( path ) )
662+ {
663+ var master = repo . Lookup < Commit > ( "master" ) ;
664+
665+ var result = repo . ObjectDatabase . CanMergeWithoutConflict ( master , master ) ;
666+
667+ Assert . True ( result ) ;
668+ }
669+ }
670+
671+ [ Fact ]
672+ public void TestMergeIntoOtherBranchHasNoConflicts ( )
673+ {
674+ string path = SandboxMergeTestRepo ( ) ;
675+ using ( var repo = new Repository ( path ) )
676+ {
677+ var master = repo . Lookup < Commit > ( "master" ) ;
678+ var branch = repo . Lookup < Commit > ( "fast_forward" ) ;
679+
680+ var result = repo . ObjectDatabase . CanMergeWithoutConflict ( master , branch ) ;
681+
682+ Assert . True ( result ) ;
683+ }
684+ }
685+
686+ [ Fact ]
687+ public void TestMergeIntoWrongBranchHasConflicts ( )
688+ {
689+ string path = SandboxMergeTestRepo ( ) ;
690+ using ( var repo = new Repository ( path ) )
691+ {
692+ var master = repo . Lookup < Commit > ( "master" ) ;
693+ var branch = repo . Lookup < Commit > ( "conflicts" ) ;
694+
695+ var result = repo . ObjectDatabase . CanMergeWithoutConflict ( master , branch ) ;
696+
697+ Assert . False ( result ) ;
698+ }
699+ }
700+
657701 private static Blob CreateBlob ( Repository repo , string content )
658702 {
659703 using ( var stream = new MemoryStream ( Encoding . UTF8 . GetBytes ( content ) ) )
You can’t perform that action at this time.
0 commit comments