예제 #1
0
        public void testNoPostOrder()
        {
            DirCache tree = DirCache.read(db);
            {
                DirCacheBuilder b = tree.builder();

                b.add(makeFile("a"));
                b.add(makeFile("b/c"));
                b.add(makeFile("b/d"));
                b.add(makeFile("q"));

                b.finish();
                Assert.AreEqual(4, tree.getEntryCount());
            }

            var tw = new GitSharp.Core.TreeWalk.TreeWalk(db);

            tw.reset();
            tw.PostOrderTraversal = false;
            tw.addTree(new DirCacheIterator(tree));

            assertModes("a", FileMode.RegularFile, tw);
            assertModes("b", FileMode.Tree, tw);
            Assert.IsTrue(tw.isSubtree());
            Assert.IsFalse(tw.isPostChildren());
            tw.enterSubtree();
            assertModes("b/c", FileMode.RegularFile, tw);
            assertModes("b/d", FileMode.RegularFile, tw);
            assertModes("q", FileMode.RegularFile, tw);
        }
예제 #2
0
        public void testNoPostOrder()
        {
            DirCache tree = DirCache.read(db);
            {
                DirCacheBuilder b = tree.builder();

                b.add(makeFile("a"));
                b.add(makeFile("b/c"));
                b.add(makeFile("b/d"));
                b.add(makeFile("q"));

                b.finish();
                Assert.AreEqual(4, tree.getEntryCount());
            }

            var tw = new GitSharp.Core.TreeWalk.TreeWalk(db);
            tw.reset();
            tw.PostOrderTraversal = false;
            tw.addTree(new DirCacheIterator(tree));

            assertModes("a", FileMode.RegularFile, tw);
            assertModes("b", FileMode.Tree, tw);
            Assert.IsTrue(tw.isSubtree());
            Assert.IsFalse(tw.isPostChildren());
            tw.enterSubtree();
            assertModes("b/c", FileMode.RegularFile, tw);
            assertModes("b/d", FileMode.RegularFile, tw);
            assertModes("q", FileMode.RegularFile, tw);
        }