tests/TestInvalidOptions.cs
/// <summary>
/// Branch already but with pass --force option
/// </summary>
Branch already but with pass --force option
Branch already but with pass -- force option
[Fact]
        public void BranchForce()
        {
            var test = InitializeTest();
            test.Repo.Refs.Add(NewBranchRef, test.Repo.Refs.Head);
            var result = Program.Main("--keep", "test.bin",
                "--repo-dir", test.Path,
                "--force",
                "--branch", NewBranch,
                @"HEAD");
            Assert.Equal(0, result);
            var repo = test.Repo;
            var headNewMaster = AssertBranchRef(repo);
            var newCommits = GetCommits(repo, headNewMaster);
            Assert.Equal(1, newCommits.Count);
            Assert.NotNull(newCommits[0].Tree["Binary/test.bin"]);
            test.Dispose();
        }
[ Fact ] public void BranchForce ( ) { var test = InitializeTest ( ) ; test . Repo . Refs . Add ( NewBranchRef , test . Repo . Refs . Head ) ; var result = Program . Main ( " " , " " , " " , test . Path , " " , " " , NewBranch , @"HEAD" ) ; Assert . Equal ( 0 , result ) ; var repo = test . Repo ; var headNewMaster = AssertBranchRef ( repo ) ; var newCommits = GetCommits ( repo , headNewMaster ) ; Assert . Equal ( 1 , newCommits . Count ) ; Assert . NotNull ( newCommits [ 0 ] . Tree [ " " ] ) ; test . Dispose ( ) ; }
Branch already but with pass --force option
Branch already but with pass -- force option
// Add an existing branch reference // Cleanup the test only if we succeed