@@ -668,6 +668,46 @@ public void TestMergeIntoSelfHasNoConflicts()
668
668
}
669
669
}
670
670
671
+ [ Fact ]
672
+ public void TestMergeIntoOtherUnbornBranchHasNoConflicts ( )
673
+ {
674
+ string path = SandboxMergeTestRepo ( ) ;
675
+ using ( var repo = new Repository ( path ) )
676
+ {
677
+ repo . Refs . UpdateTarget ( "HEAD" , "refs/heads/unborn" ) ;
678
+
679
+ Touch ( repo . Info . WorkingDirectory , "README" , "Yeah!\n " ) ;
680
+ repo . Index . Clear ( ) ;
681
+ repo . Stage ( "README" ) ;
682
+
683
+ repo . Commit ( "A new world, free of the burden of the history" , Constants . Signature , Constants . Signature ) ;
684
+
685
+ var master = repo . Branches [ "master" ] . Tip ;
686
+ var branch = repo . Branches [ "unborn" ] . Tip ;
687
+
688
+ Assert . True ( repo . ObjectDatabase . CanMergeWithoutConflict ( master , branch ) ) ;
689
+ }
690
+ }
691
+
692
+ [ Fact ]
693
+ public void TestMergeIntoOtherUnbornBranchHasConflicts ( )
694
+ {
695
+ string path = SandboxMergeTestRepo ( ) ;
696
+ using ( var repo = new Repository ( path ) )
697
+ {
698
+ repo . Refs . UpdateTarget ( "HEAD" , "refs/heads/unborn" ) ;
699
+
700
+ repo . Index . Replace ( repo . Lookup < Commit > ( "conflicts" ) ) ;
701
+
702
+ repo . Commit ( "A conflicting world, free of the burden of the history" , Constants . Signature , Constants . Signature ) ;
703
+
704
+ var master = repo . Branches [ "master" ] . Tip ;
705
+ var branch = repo . Branches [ "unborn" ] . Tip ;
706
+
707
+ Assert . False ( repo . ObjectDatabase . CanMergeWithoutConflict ( master , branch ) ) ;
708
+ }
709
+ }
710
+
671
711
[ Fact ]
672
712
public void TestMergeIntoOtherBranchHasNoConflicts ( )
673
713
{
0 commit comments