コード例 #1
0
        public void SynchNow_OnNamedBranchAndDefaultBranchExists_DoesNotMergeWithIt()
        {
            using (var repo = new RepositorySetup("bob"))
            {
                if (repo.Synchronizer == null)
                    repo.Synchronizer = repo.CreateSynchronizer();
                repo.Synchronizer.SynchronizerAdjunct = new ProgrammableSynchronizerAdjunct("default");
                repo.AddAndCheckinFile("test.txt", "apple");
                var afterFirstCheckin = repo.CreateBookmarkHere();
                repo.ChangeFileAndCommit("test.txt", "pear", "second on default");

                afterFirstCheckin.Go();
                repo.Repository.BranchingHelper.Branch(new ConsoleProgress(), "animals");
                repo.Synchronizer.SynchronizerAdjunct = new ProgrammableSynchronizerAdjunct("animals");
                repo.ChangeFileAndCommit("test.txt", "dog", "first on animals");
                var animalHead = repo.CreateBookmarkHere();

                repo.AssertHeadCount(2);
                repo.CheckinAndPullAndMerge();
                repo.AssertHeadCount(2);
                animalHead.AssertRepoIsAtThisPoint();
            }
        }