Instead of mucking with the TreeWalk API, we can do this through a TreeFilter:

  class SkipWorkTreeFilter {
    private final int treeIdx;

    SkipWorkTreeFilter(int treeIdx) {
      this.treeIdx = treeIdx;
    }

    boolean include(TreeWalk walker) {
      DirCacheIterator i = walker.getTree(treeIdx);
      if (i == null)
        return true;

      DirCacheEntry e = i.getDirCacheEntry();
      return e == null || !e.isSkipWorkTree();
    }
  }

Callers who want work tree skipping can just and this filter in with any other filters they are running on the TreeWalk.