Example #1
0
        public void Environment_ForBranchName()
        {
            const string envName  = "DOCFX_SOURCE_BRANCH_NAME";
            var          original = Environment.GetEnvironmentVariable(envName);

            try
            {
                Environment.SetEnvironmentVariable(envName, "special-branch");
                var info = GitUtility.GetFileDetail(Directory.GetCurrentDirectory());
                Assert.Equal("special-branch", info.RemoteBranch);
            }
            finally
            {
                Environment.SetEnvironmentVariable(envName, original);
            }
        }
Example #2
0
        public void Environment_ForBranchName()
        {
            var info = GitUtility.GetFileDetail(Directory.GetCurrentDirectory());

            Assert.Equal("special-branch", info.RemoteBranch);
        }