We need to special case when dirCacheIndex or workingTreeIndex are pointing at a tree.  We always need to recurse into the subtree because the WorkingTreeIterator cannot provide an ObjectId to bypass the subtree on equality alone, and the filter is invoked before the recursive flag of the TreeWalk is considered.