Class DirCacheIterator

java.lang.Object
org.eclipse.jgit.treewalk.AbstractTreeIterator
org.eclipse.jgit.dircache.DirCacheIterator
Direct Known Subclasses:
DirCacheBuildIterator

public class DirCacheIterator extends AbstractTreeIterator
Iterate a DirCache as part of a TreeWalk.

This is an iterator to adapt a loaded DirCache instance (such as read from an existing .git/index file) to the tree structure used by a TreeWalk, making it possible for applications to walk over any combination of tree objects already in the object database, index files, or working directories.

See Also:
  • Field Details

    • cache

      protected final DirCache cache
      The cache this iterator was created to walk.
    • ptr

      protected int ptr
      Index of entry within cache.
    • currentEntry

      protected DirCacheEntry currentEntry
      The current file entry from cache.
    • currentSubtree

      protected DirCacheTree currentSubtree
      The subtree containing currentEntry if this is first entry.
  • Constructor Details

    • DirCacheIterator

      public DirCacheIterator(DirCache dc)
      Create a new iterator for an already loaded DirCache instance.

      The iterator implementation may copy part of the cache's data during construction, so the cache must be read in prior to creating the iterator.

      Parameters:
      dc - the cache to walk. It must be already loaded into memory.
  • Method Details