Пример #1
0
        public void When_pushing_Then_push_nodes_and_update_branchpointer_on_server()
        {
            var remoteGit    = new RepoBuilder().BuildEmptyRepo();
            var gitServer    = SpinUpServer(remoteGit, 18083);
            var localbuilder = new RepoBuilder();
            var localGit     = localbuilder.Build2Files3Commits();

            localbuilder.AddLocalHostRemote(18083);

            Branch branch  = localGit.Hd.Branches["master"];
            var    commits = localGit.GetReachableNodes(branch.Tip).ToArray();

            new GitNetworkClient().PushBranch(localGit.Hd.Remotes.First(), "master", branch, null, commits);

            Assert.Equal(@"Log for master
* d2c19da - Add a2 (2017/03/03 03:03:03) <kasper> 
* 5b65531 - Add b (2017/02/02 02:02:02) <kasper> 
* 27047ec - Add a (2017/01/01 01:01:01) <kasper> 
", remoteGit.Log());
            gitServer.Abort();
        }
Пример #2
0
        public void When_pushing_Then_push_nodes_and_update_branchpointer_on_server()
        {
            var remoteGit    = new RepoBuilder().BuildEmptyRepo();
            var gitServer    = SpinUpServer(remoteGit, 18083);
            var localbuilder = new RepoBuilder();
            var localGit     = localbuilder.Build2Files3Commits();

            localbuilder.AddLocalHostRemote(18083);

            Branch branch  = localGit.Hd.Branches["master"];
            var    commits = localGit.GetReachableNodes(branch.Tip).ToArray();

            new GitNetworkClient().PushBranch(localGit.Hd.Remotes.First(), "master", branch, null, commits);

            var actual = remoteGit.Log();

            Assert.Equal(@"
Log for master
* e7ea1966e7cb9b96e956a53d4a7042aa4dcc69720363dd928087af50a8c26b32 - Add a2 (2017/03/03 03:03:03) <kasper> 
* ed0ea7ea22cbaf8b34ee711974568d42853aff967fdb8c21fac93788d8e8e954 - Add b (2017/02/02 02:02:02) <kasper> 
* f0800442b12313bbac440b9ae0aef5b2c1978c95e8ccaf4197d6816bd29bf673 - Add a (2017/01/01 01:01:01) <kasper> 
", actual);
            gitServer.Abort();
        }