public virtual void testDF_GapByOne()
        {
            DirCache tree0 = DirCache.read(db);
            DirCache tree1 = DirCache.read(db);
            {
                DirCacheBuilder b0 = tree0.builder();
                DirCacheBuilder b1 = tree1.builder();

                b0.add(makeEntry("a", REGULAR_FILE));
                b0.add(makeEntry("a.b", EXECUTABLE_FILE));
                b1.add(makeEntry("a.b", EXECUTABLE_FILE));
                b1.add(makeEntry("a/b", REGULAR_FILE));
                b0.add(makeEntry("a0b", SYMLINK));

                b0.finish();
                b1.finish();
                Assert.AreEqual(3, tree0.getEntryCount());
                Assert.AreEqual(2, tree1.getEntryCount());
            }

            NameConflictTreeWalk tw = new NameConflictTreeWalk(db);
            tw.reset();
            tw.addTree(new DirCacheIterator(tree0));
            tw.addTree(new DirCacheIterator(tree1));

            assertModes("a", REGULAR_FILE, TREE, tw);
            Assert.IsTrue(tw.isSubtree());
            tw.enterSubtree();
            assertModes("a/b", MISSING, REGULAR_FILE, tw);
            assertModes("a.b", EXECUTABLE_FILE, EXECUTABLE_FILE, tw);
            assertModes("a0b", SYMLINK, MISSING, tw);
        }
Пример #2
0
		    public InCoreMerger(Repository local) : base(local)
            {
			    _tw = new NameConflictTreeWalk(Db);
			    _cache = DirCache.newInCore();
		    }