Example #1
0
        public void WhenCloningFunctionalTestVtccdsWithBranchesRenaming_ThenAllRenamesShouldBeWellHandled()
        {
            h.SetupFake(r =>
            {
                r.SetRootBranch("$/vtccds/trunk");
                vtccds.Prepare(r);
            });
            h.TfsUrl = "https://tfs.codeplex.com:443/tfs/TFS16";
            h.Run("clone", h.TfsUrl, "$/vtccds/trunk", "Vtccds", "--branches=all");

            AssertNewClone("Vtccds", new[] { "refs/heads/master", "refs/remotes/tfs/default" }, commit: "e7d54b14fbdcbbc184d58e82931b7c1ac4a2be70");

            AssertNewClone("Vtccds", new[] { "refs/heads/b1", "refs/remotes/tfs/b1" }, commit: "3cdb2a311ac7cbda1e892a9b3371a76c871a696a");

            AssertNewClone("Vtccds", new[] { "refs/heads/b1.1", "refs/remotes/tfs/b1.1" }, commit: "e6e79221fd35b2002367a41535de9c43b626150a");

            AssertNewClone("Vtccds", new[] { "refs/heads/renameFile", "refs/remotes/tfs/renameFile" }, commit: "003ca02adfd9561418f05a61c7a999386957a146");

            AssertNewClone("Vtccds", new[] { "refs/remotes/tfs/branch_from_nowhere" }, commit: "9cb91c60d76d00af182ae9f16da6e6aa77b88a5e");

            AssertNewClone("Vtccds", new[] { "refs/heads/renamed3", "refs/remotes/tfs/renamed3" }, commit: "615ac5588d3cb6282c2c7d514f2828ad3aeaf5c7");

            //No refs for renamed branches
            h.AssertNoRef("Vtccds", "refs/remotes/tfs/renamedTwice");
            h.AssertNoRef("Vtccds", "refs/remotes/tfs/afterRename");
            h.AssertNoRef("Vtccds", "refs/remotes/tfs/testRename");
        }
Example #2
0
 public void BootstrapWithNoRemotes()
 {
     h.SetupGitRepo("repo", g =>
     {
         g.Commit("A sample commit.");
     });
     h.RunIn("repo", "bootstrap");
     h.AssertNoRef("repo", "tfs/default");
 }
Example #3
0
        public void InitializesWithGitignore()
        {
            // Tests both:
            //   1. No extraneous "master" branch is introduced when gitconfig calls for "main" as the initial branch
            //   2. The initial .gitignore commit is on both the main branch and the tfs remote so they have common history

            string gitignoreFile    = Path.Combine(h.Workdir, "gitignore");
            string gitignoreContent = "*.exe\r\n*.com\r\n";

            File.WriteAllText(gitignoreFile, gitignoreContent);

            h.SetupFake(r => { });
            h.RunInWithConfig(".", "GitTfs.Test.Integration.GlobalConfigs.mainDefaultBranch.gitconfig", "init", "http://my-tfs.local/tfs", "$/MyProject", "MyProject", $"--gitignore={gitignoreFile}");
            h.AssertNoRef("MyProject", "refs/heads/master");
            h.AssertRef("MyProject", "refs/heads/main", "077fd68c084ef718a505f0a7375330c68d699f40");
            h.AssertRef("MyProject", "refs/remotes/tfs/default", "077fd68c084ef718a505f0a7375330c68d699f40");
        }