Support recreating a .git/index through DirCache
The DirCacheBuilder is meant for building up a new DirCache content
by iterating through the paths in proper Git sort order. This is
mostly useful during a TreeWalk, where the paths are being fed to
the application in the correct sort ordering. Appending them into
the new entry table in order avoids sorting costs later on when we
try to write the file back to disk.
The API is designed for speed, not ease-of-use. Performing updates
in order and by copying large ranges of the existing index into the
new index is incredibly fast, but requires the application to work
harder to construct the right sequence of calls.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>