public void testWrap() { GitSharp.TreeWalk.TreeWalk tw = new GitSharp.TreeWalk.TreeWalk(db); TreeFilter a = TreeFilter.ALL; TreeFilter n = NotTreeFilter.create(a); Assert.NotNull(n); Assert.IsTrue(a.include(tw)); Assert.IsFalse(n.include(tw)); }
public virtual void testNoDF_NoGap() { 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", REGULAR_FILE)); b0.add(makeEntry("a0b", SYMLINK)); b0.finish(); b1.finish(); Assert.AreEqual(3, tree0.getEntryCount()); Assert.AreEqual(1, tree1.getEntryCount()); } GitSharp.TreeWalk.TreeWalk tw = new GitSharp.TreeWalk.TreeWalk(db); tw.reset(); tw.addTree(new DirCacheIterator(tree0)); tw.addTree(new DirCacheIterator(tree1)); assertModes("a", REGULAR_FILE, MISSING, tw); assertModes("a.b", EXECUTABLE_FILE, MISSING, tw); assertModes("a", MISSING, TREE, tw); tw.enterSubtree(); assertModes("a/b", MISSING, REGULAR_FILE, tw); assertModes("a0b", SYMLINK, MISSING, tw); }
public void testNotALL_IncludesNothing() { GitSharp.TreeWalk.TreeWalk tw = new GitSharp.TreeWalk.TreeWalk(db); Assert.IsFalse(TreeFilter.ALL.negate().include(tw)); }
public void testANY_DIFF_IncludesSingleTreeCase() { GitSharp.TreeWalk.TreeWalk tw = new GitSharp.TreeWalk.TreeWalk(db); Assert.IsTrue(TreeFilter.ANY_DIFF.include(tw)); }
public void testALL_IncludesAnything() { GitSharp.TreeWalk.TreeWalk tw = new GitSharp.TreeWalk.TreeWalk(db); Assert.IsTrue(TreeFilter.ALL.include(tw)); }