tests/TestTreeFilteringScripts.cs
/// <summary>
/// Make sure that order is satisfied when using scripts (so first pattern is matched and stops).
/// </summary>
Make sure that order is satisfied when using scripts (so first pattern is matched and stops).
Make sure that order is satisfied when using scripts ( so first pattern is matched and stops ) .
[Fact]
        public void PatternsScriptsOrder()
        {
            var test = InitializeTest();
            Assert.Equal(0, Program.Main("--keep", "a.txt => entry.Discard = false;",
                "--keep", "* => entry.Discard = true;",
                "--repo-dir", test.Path,
                "--branch", NewBranch,
                @"HEAD"));
            var repo = test.Repo;
            var headNewMaster = AssertBranchRef(repo);
            var newCommits = GetCommits(repo, headNewMaster);
            Assert.Equal(1, newCommits.Count);
            var commit = newCommits[0];
            {
                Assert.Equal(1, commit.Tree.Count);
                Assert.NotNull(commit.Tree["a.txt"]);
            }
            test.Dispose();
        }
[ Fact ] public void PatternsScriptsOrder ( ) { var test = InitializeTest ( ) ; Assert . Equal ( 0 , Program . Main ( " " , " " , " " , " " , " " , test . Path , " " , NewBranch , @"HEAD" ) ) ; var repo = test . Repo ; var headNewMaster = AssertBranchRef ( repo ) ; var newCommits = GetCommits ( repo , headNewMaster ) ; Assert . Equal ( 1 , newCommits . Count ) ; var commit = newCommits [ 0 ] ; { Assert . Equal ( 1 , commit . Tree . Count ) ; Assert . NotNull ( commit . Tree [ " " ] ) ; } test . Dispose ( ) ; }
Make sure that order is satisfied when using scripts (so first pattern is matched and stops).
Make sure that order is satisfied when using scripts ( so first pattern is matched and stops ) .
// Cleanup the test only if we succeed