Implement a new .git/index (aka dircache) read interface
This is a smaller (and faster) .git/index file reader and it will be
an eventual replacement for the current GitIndex class.
We silently skip optional extensions, which means we silently skip the
current 'TREE' extension. We also fail out if we identify a required
extension which we do not support.
Most of each index entry is held in a shared byte[] as we do not need
most of the fields in jgit, due to Java's lack of a POSIX lstat like
utility. This makes it more efficient for us to read the C Git index
format as we can avoid expending a lot of CPU on decode calls during
the file read.
Lookup is handled by binary searching against the encoded paths, as
this lines up better with how TreeWalk and its TreeFilters operate.
Most of the time when we are looking for something in the index it
is a quick read-find+update-write cycle affecting only a handful of
paths. Avoiding any unnecessary byte[]->String->byte[] translations
during these operations performance.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>